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. Linux企业级项目实践之网络爬虫(1)——项目概述及准备工作

    我们在学习了Linux系统编程之后,需要一些实战项目来提高自己的水平,本系列我们通过编写一个爬虫程序,将我们学习的知识进行综合应用,同时在实现项目的过程中逐渐养成一些有用的思维方式,并具有初步的软件开 ...

  2. C# 实现MD5 Hash 计算

    C#提供了一系列的加密库,可以让我们自由使用,这里我来介绍如何使用C#的加密库实现MD5 hash值的计算工作. 参考代码: private static String CalcMd5(String ...

  3. Java中的XML操作

    1.DOM方式解析(读取)XML文件 待解析(读取)的XML文件,直接放在项目根目录下即可 <?xml version="1.0" encoding="UTF-8& ...

  4. 转:TestLink1.9.3测试用例:Excel转换XML工具<二>实现代码

    TestLink1.9.3测试用例:Excel转换XML工具<二>实现代码 http://blog.csdn.net/candle806/article/details/7490599 以 ...

  5. PHP中获取文件扩展名

    function get_extension($file) { return substr(strrchr($file, '.'), 1) ; } function get_extension($fi ...

  6. IOS UIlabel设置文本距离边框距离

    自定义UILabel 继承 UILabel 重写drawTextInRect 方法具体如下: CGRect rect = CGRectMake(rect.origin.x + 5, rect.orig ...

  7. wpf新增记录时用多线程的问题

    多线程虽然可以增加用户操作体验,但是有时候会出现意想不到的错误. 如果采用分布式,数据库在另外服务器上,当网络出现问题,或者数据库繁忙,那么新增数据就会等待,这时候用户如果以为没有操作,而多次点击新增 ...

  8. C++内存分配的五种方法

    在C++中,内存分成5个区,他们分别是堆.栈.自由存储区.全局/静态存储区和常量存储区. 栈,就是那些由编译器在需要的时候分配,在不需要的时候自动清楚的变量的存储区.里面的变量通常是局部变量.函数参数 ...

  9. Oracle—RMAN备份(一)

    一.RMAN备份相关概念 1.RMAN备份中表空间不需要处于backup模式下,它备份数据文件,归档日志文件,控制文件,spfile和备份集片,但不备份联机重做日志文件,临时文件和口令文件. 2.备份 ...

  10. JS高级程序设计学习笔记之JS事件(1)

    事件流 冒泡 定义:事件开始时由最具体的元素接收,然后逐级上传到较为不具体的节点.(IE9.FF.Chrome.Safari会将事件一直冒泡到window对象.IE5.5及其以下会跳过<html ...