Signtool Error: This file format cannot be signed because it is not recognized VBS File RRS feed

  • Question

  • If I want to sign the file locally everything works. However, if I want to sign the file on the web server, the following error "Signtool Error: This file format cannot be signed because it is not recognized" occurs
    Scenario: I have a web page where I sign the file when I use Visual Studio and IIS Express to make it work.
    When I do it with the external web server it doesn't work.
    If I execute the command directly on the web server via PowerShell, the same error message appears again.

    cmd: C:\CodeSignerTools\Signtools\signtool\signtool.exe sign /v /sm /s My /n "BURAUT VBS SAIFR - V9" /fd sha256 /tr http://tsa.pki.admin.ch/tsa /td sha256 "C:\CodeSignerUploadedFiles\20191029-112048232_U80849259_test.vbs\test.vbs"

    Wednesday, October 30, 2019 10:19 AM

All replies

  • You cannot sign or edit a file on a web server,

    Visual studio can open and edit files on a web server that it has set up as a project because it uses special utilities to do it.

    You can use the signing tool from Visual studio,  Post in the VS forum for assistance on how to do this.

    Your question is not a scripting issue.  It is an issue of understanding web servers and web development tools.  For that you need to post in web server and development tool forums.

    Web issues can be posted in one of the two forums below:



    These are special forums set up by Microsoft for web server issues.


    Thursday, October 31, 2019 6:09 AM
  • A web page is hosted on the web server and I can sign files there. Maybe I have explained all this specifically.

    I can sign all these files on the server: .exe, .dll, .dotm, .docm, .docx, .xlam, .xlsb, .xlsm, .xlsx, .xltm, .xltx, .pptm, .potm, .potx, .pptx, .ppsm, .ppsx, .jar, .xml, .appx, .msix, .ps1, .zip

    The problem is locally I can sign .vbs and not on the web server.
    Thursday, October 31, 2019 6:54 AM
  • Not a scripting issue. It is a web server issue`. Copy the file locally and copy it back. Thye file may also be in Unicode and the old VBS signtool can only sign ASCII/ANSI files.


    Thursday, October 31, 2019 7:05 AM
  • I don't see why you are saying the file is on a web server, It is on the local "C" drive.


    That file in in the local file system.

    The error is telling you that the file is in the wrong encoding or is damaged.


    Thursday, October 31, 2019 7:15 AM
  • the same signtool on the local Webserver and on the "external" Webserver.

    here the logfiles

    INFO 2019-10-31 08:31:58,284 [7] SignLog - Upload dir created: C:\_TFS\AZD-VZD\CodeSigner2\CodeSigner2\UploadedFiles\20191031-083158253_U80849259_test.vbs
    INFO 2019-10-31 08:31:58,385 [7] SignLog - No virus found with scanner: C:\Program Files\Windows Defender\MpCmdRun.exe
    INFO 2019-10-31 08:31:58,385 [7] SignLog - Anti-virus scanning passed
    INFO 2019-10-31 08:31:58,739 [7] SignLog - File C:\_TFS\AZD-VZD\CodeSigner2\CodeSigner2\UploadedFiles\20191031-083158253_U80849259_test.vbs\test.vbs successfully signed.
    INFO 2019-10-31 08:31:58,739 [7] SignLog - Command : C:\_TFS\AZD-VZD\CodeSigner2\CodeSigner2\Tools\Signtools\signtool\signtool.exe sign /v /sm /s My /n "BURAUT VBS SAIFR - Vtest" /fd sha256 /tr http://tsa.pki.admin.ch/tsa /td sha256 "C:\_TFS\AZD-VZD\CodeSigner2\CodeSigner2\UploadedFiles\20191031-083158253_U80849259_test.vbs\test.vbs"

    external Webserver:
    INFO 2019-10-31 08:14:03,846 [7] SignLog - Upload dir created: C:\CodeSignerUploadedFiles\20191031-081403830_U80849259_test.vbs
    INFO 2019-10-31 08:14:03,892 [7] SignLog - No virus found with scanner: C:\Program Files\Windows Defender\MpCmdRun.exe
    INFO 2019-10-31 08:14:03,892 [7] SignLog - Anti-virus scanning passed
    ERROR 2019-10-31 08:14:03,971 [7] SignLog - Error while signing : SignTool Error: This file format cannot be signed because it is not recognized.
    SignTool Error: An error occurred while attempting to sign: C:\CodeSignerUploadedFiles\20191031-081403830_U80849259_test.vbs\test.vbs
    INFO 2019-10-31 08:14:03,971 [7] SignLog - Command : C:\CodeSignerTools\Signtools\signtool\signtool.exe sign /v /sm /s My /n "BURAUT VBS SAIFR - V9" /fd sha256 /tr http://tsa.pki.admin.ch/tsa /td sha256 "C:\CodeSignerUploadedFiles\20191031-081403830_U80849259_test.vbs\test.vbs"

    Thursday, October 31, 2019 7:33 AM
  • Are you executing this with some kind of remoting system? 

    Again - this is not the correct forum for your issue. This is a scripting forum and not a tools or web forum.


    Thursday, October 31, 2019 7:38 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, November 8, 2019 12:58 PM