I'm running Windows 7 and when I try to run a batch file, it says, "The publisher could not be verified. Are you sure you want to run this software?"

So when I try to sign it with my code signing certificate, it says "SignTool Error: This file format cannot be signed because it is not recognized."

So I'm stuck between a rock an a hard place. Is there a way to eliminate either message?

What you are seeing is a general prompt that Windows provides whenever you try to open any time of file that has been downloaded. What happens is that when you download a file, it is tagged with a flag that indicates that it came from the Internet and is thus potentially dangerous. When you try to run such a file, Windows checks to see if it has a valid signature in order to determine if it can be trusted.

What you can do is to strip the flag from the file by using the Unblock button in the file’s properties, after which, Windows will leave you alone whenever you try to run it:


The problem is that batch-files are text-files that can be executed. While it is possible to sign a text-file, it will end up appending a bunch of binary data to the file which for a batch-file is bad because it is gibberish and will cause problems when the command-interpreter tries to execute it. Commenting out the signature will not work either because then the signature becomes corrupt.

Therefore, signing a batch file is not going to work.

What you need to do is to figure out why the system is prompting you when trying to run it. By default, Windows does not ask before running batch-files, so you must have a either a special policy or security program blocking it. Check your security program(s) to see if there is a verification setting that you can disable or add an exclusion for.

Also check the batch-file’s contents to see if it is running an executable that is not signed (though again, by default, Windows does not prompt for executables unless it was downloaded or requires elevated privileges, so check your settings).

http://superuser.com/questions/470463/how-to-sign-a-windows-batch-bat-file

Windows文件居然有解锁一说,并且还会引起SignTool Error,真是昏倒!的更多相关文章

  1. windows 文件权限导致的 git 问题

    windows 文件权限导致的 git 问题 在 windows 上使用 git 时,会遇到明明什么都没有改动,但是 git status 显示一堆文件被修改.这时,通过 git diff 可看到什么 ...

  2. Linux文件和windows文件在 换行符的区别

    Linux或Unix文件,和windows文件,在来回处理时,如果不注意 换行符的区别,可能导致程序错误!!!深刻的教训.... 在早期的打印机时代,开始新的一行要占用两个字符的时间.如果到了一行的结 ...

  3. Linux与Windows文件传输实现

    Linux与Windows文件传输实现 一.概述 在学习Linux服务器的时候,我们有时需要与Windows下的文件进行交互传输,这个时候我们需要如何实现呢?今天是我第一次在博客园上写文章,此时正值学 ...

  4. Linux与windows文件乱码问题

    Linux与windows文件乱码问题 */--> Linux与windows文件乱码问题 Table of Contents 1. 简介 2. iconv详解 2.1. iconv –help ...

  5. 安装Office时出现windows installer服务不能更新一个或多个受保护的windows文件错误的解决方法

    今天在Windows XP上安装Microsoft Office 2010时,总是遇到“Windows Installer服务不能更新一个或多个受保护的windows文件,安装失败,正在回滚更改”提示 ...

  6. office2010安装出错,windows installer服务不能更新一个或多个受保护的windows文件

    转自:http://www.08lr.cn/article/1985.html office2010安装过程中出现如下图错误:windows installer 服务不能更新一个或多个受保护的wind ...

  7. 去掉windows文件末尾的^M: %s/\r//g

    去掉windows文件末尾的^M: %s/\r//g

  8. Windows文件监视器 1.0 绿色版

    软件名称:软件名称: Windows文件监视器 软件语言: 简体中文 授权方式: 免费软件 运行环境: Win7 / Vista / Win2003 / WinXP / Win2008 软件大小: 1 ...

  9. linux的wc -l 命令统计文件少一行(一般是windows文件)

    先简单介绍 wc(Word Count)命令的功能为统计指定文件中的字节数.字数.行数,并将统计结果显示输出 格式:wc file 命令参数: -c 统计Bytes数(字节数),并显示文件名 -l 统 ...

随机推荐

  1. android开发论坛

    http://www.hiapk.com/ http://bbs.hiapk.com/ http://bbs.gfan.com/ http://bbs.anzhi.com/ http://www.ap ...

  2. SQL Server 通过一个表和另一个表联合 批量更新这个表的字段

    UPDATE OutPzPersonSet SET cPerson = a.AAA --SELECT * FROM OutPzPersonSet d INNER JOIN AAAA a ON d.cz ...

  3. 优质办公体验,掌上OA一机hold住全场

    20多年前,人们希望可以脱离文件满天飞的办公办公环境,OA办公自动化出现了:随后.人们希望能在不同部门.不同分支机构间互通有无,打破信息孤岛.应用孤岛.数据孤岛,协同OA出现了:今天,人们梦想随时随地 ...

  4. 【开源】Hawk-数据抓取工具:简明教程

    1.软件介绍 HAWK是一种数据采集和清洗工具,依据GPL协议开源,能够灵活,有效地采集来自网页,数据库,文件, 并通过可视化地拖拽, 快速地进行生成,过滤,转换等操作.其功能最适合的领域,是爬虫和数 ...

  5. 算法导论(第三版)Exercises4.2(第四章二节)

    4.2-1(计算结果) 18  14 62  66 4.2-2(Strassen算法计算矩阵乘法) void multiplyMatrix(int a[], int b[], int n, int r ...

  6. zoj 3706 Break Standard Weight(dp)

    Break Standard Weight Time Limit: 2 Seconds                                     Memory Limit: 65536 ...

  7. alert 在手机浏览器会显示网址,怎么能去掉这个网址

    之前就看到有人发过这帖子,现在自己也遇到这问题了. 目前想到的一个解决方案,是用jquery的模拟的alert插件进行代替,可是找的几个插件都不能实现alert的阻塞功能.怎么破 ,具体解决方案如下: ...

  8. python查看删除你微信的账号

    #应用环境:python2.7 #!/usr/bin/env python # coding=utf-8 from __future__ import print_function import os ...

  9. ASP.net获取当前页面的文件名,参数,域名等方法

    ASP.net后台获取当前页面的文件名 System.IO.Path.GetFileName(Request.Path).ToString(); 获取当前页面文件名,参数,域名等方法 假设当前页完整地 ...

  10. js数组 函数

    js数组 filter(),map(),some(),every(),forEach(),lastIndexOf(),indexOf() 文章1:http://www.jb51.net/article ...