Click to See Complete Forum and Search --> : Dos scripting


laasunde
February 15th, 2008, 06:39 AM
Hi. Trying to develop a dos script but need some help. Basically I've got a utility dllcheck that takes an dll or exe as argument and outputs all its dependencies.


c:\Myfolder\bin>DllCheck.exe /m aapc.dll

c:\Myfolder\bin\KBasis.dll
c:\Myfolder\bin\KiConf.dll
C:\WINDOWS\system32\ole32.dll
C:\WINDOWS\system32\MFC70.DLL
...


Taking the above script a bit further I can search for a specific file being used.


DllCheck.exe /m aapc.dll | findstr "ole"
C:\WINDOWS\system32\ole32.dll


How can I using a dos batch script run that above command and then check how many entries with "ole" a given file contains? Say for instance I iterate through many files and would only like to output a text if the file contains a ref. to "ole" - how could I achieve this?

Currently doing this;

for /r %%f in (*.dll) do ((echo ***%%~nxf & DllCheck.exe /m %%f | findstr "ole") >> Output.log)


Second question, is it safe to assume that if a dll or exe has a dependency to mscoree.dll that is uses .NET resources?

Using WinXP btw.

laasunde
February 15th, 2008, 09:12 AM
Just an update. By doing this (see below) I get an output of either 0 or 1 to the console. How can I place the output of the below command into an expression like:

if output_value==1 do X else if output_value==0 do Y

or code to that affect?


c:\DllCheck.exe /m aaispc.dll | find /c "ole"
0