powershellbatch-filecode-signingcode-signing-certificatecodesign

How to sign every ocx, dll and exe file


I am using signtool to sign my files.

How to recursively search all the ocx, dll and exes in a folder and subfolder then sign them all using Command Prompt ? I want to sign only the ones developed by me and not the third party ones.


Solution

  • Try

    @echo off FOR /f "tokens=*" %%G IN ('dir /s *.dll *.ocx *.exe') DO ( echo %%G set A= "%%G" signtool sign /f "C:\Certificates\FakeCertificate.pfx" %A%
     )