Jump to content

Using @ComSpec or Closing Command Prompt (revisited)


Recommended Posts

Hello,

I am checking code with Microsoft BinScope 2014. It runs in a command line. You may be familiar with it if you are testing security for DLLs.

Anyway, I get a directory of .DLL and corresponding Symbol .PDB files from developers. The .dll and .pdb filenames have to match to run BinScope on them.

I create an array of DLL files, then an array of PDB files, compare the files to make sure I am only testing matching filenames, and then running them through BinScope.

I have the automated script running but because I am having problem with @ComSpec, I am using Run("CMD.exe").  It leaves a DOS box for every file. Here is some code:

For $i = $iDllCount to $aTestDllList[1]
        $iDllCount += 1
        $sCmd = "Binscope "&$sPath&$sDllFile
          ;MsgBox($MB_OK,"","File to test is "&$sDllFile&" DLLCount is "&$iDllCount)
        Run("CMD.exe","")
        Sleep(500)
        Send("CD C:\Program Files\Microsoft BinScope 2014\{Enter}")
        Sleep(500)
        Send($sCmd&"{Enter}")
        ;RunWait(@ComSpec & " /c " & "Binscope /Target "&$sDllFile,'""C:\Program Files\Microsoft BinScope 2014\""') Commented out
    Next


If I could use RunWait(@ComSpec " /c "... the DOS box would close automatically. However I can't get that to work.

I have tried

RunWait(@ComSpec&" /k "&'""Binscope.exe C:\testdll\apiREST.dll""', '""C:\Program Files\Microsoft BinScope 2014""')

RunWait(@ComSpec&" /k "&'""C:\Program Files\Microsoft BinScope 2014\Binscope.exe C:\testdll\apiREST.dll""', '""C:\Program Files\Microsoft BinScope 2014""')

In any case using the RunWait command does not work. Using Run("CMD.exe") does. I would like to close the DOS box after each file is run.

I need to either get RunWait (@ComSpec...) running OR close each DOS box after BinScope is done.

Any help is appreciated!

JibsMan

Link to comment
Share on other sites

C:\Users\Owner>start /?
Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/AFFINITY <hex affinity>] [/WAIT] [/B] [command/program]
      [parameters]

 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...