How to recursively search all the ocx, dll and exes in a folder and subfolder then sign them all barring thie third party ones, using a batch file?

StackOverflow https://stackoverflow.com/questions/19672936

سؤال

I am using signtool to sign my msi.

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

هل كانت مفيدة؟

المحلول 2

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% )

نصائح أخرى

If you have set the file properties at compile time, you can get them via wmic. Try

wmic datafile where name='c:\\windows\\system32\\calc.exe'  get Manufacturer

Use wmic datafile where name='P:\\ath\\to\\file' to view all the available fields. Use wmic datafile get /? to get help.

As foxidrive has commented, recursion is easy. Search stackoverflow or try for /r batch command

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top