I ' m running Windows 7 and when I try to run a batch file, it says, "the publisher could isn't be verified. Is you sure want to run this software? "
If I try to sign it with my Code signing certificate, it says "SignTool error:this file format cannot be signed Beca Use it was not recognized. "
So I ' m stuck between a, rock an A. Is there a-to eliminate either message?
What's seeing is a general prompt this Windows provides whenever you try to open any time the file that have been down Loaded. What's happens is if you download a file, it's tagged with a flag this 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 had a valid signature in order to determine if it can be Trus Ted.
What's the Strip the flag from the file by using the Unblock button in the file ' s properties, after WH Ich, Windows would leave you alone whenever-try to run it:
The problem is, Batch-files is text-files, can be executed. While it's possible to sign a text-file, it'll end up appending a bunch of binary data to the file which for a Batch-fi Le is-because it is gibberish and would cause problems when the command-interpreter tries to execute it. Commenting out the signature won't work either because then the signature becomes corrupt.
Therefore, signing a batch file is not going to work.
What are need to does is to figure out why the system was prompting you when trying to run it. By default, Windows does isn't ask before running batch-files, so you must has a either a special policy or security Progra M blocking it. Check your security program (s) to see if there is a verification setting so you can disable or add an exclusion for.
Also Check the Batch-file ' s contents to see if it's running an executable that's not signed (though again, by default, W Indows does not prompt for executables unless it is downloaded or requires elevated privileges, so check your settings).
Http://superuser.com/questions/470463/how-to-sign-a-windows-batch-bat-file
Windows files actually have Jian Yi said, and will also cause signtool Error, really fainted!