Jump to content

Run(Wait) failures


Recommended Posts

If I run "stripcat scandataF.dta" (or scandataF.bat which has same script) from command line it works without error but if I run from AutoIt script it fails

I have tried

; > not work    $DOS = RunWait(@ComSpec & ' /c "stripcat.exe "scandataF.dta' & @CRLF, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
;   $DOS = RunWait(@ComSpec & " /k " & "scandataF.bat" & @CRLF, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
;  Run("scandataF.bat")

The "not work" line doesn't throw any error but also doesn't function. Both Run & RunWait do throw the Micro$oft error.

Stripcat_Error.jpg

The most powerful number in the Universe.  Zero.

Link to comment
Share on other sites

Correction! No. It doesn't work.

Take this:

$DOS = Run(@ComSpec & " /k " & "ncat 192.168.1.6 80 <getdata >scan1.dta", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
  $DOS = Run(@ComSpec & " /k " & "ncat 192.168.1.6 80 <getdata >scan2.dta", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
  If( $scanmode <> "baseline") Then
   ShellExecute("Stripcat.exe", "scandataF.dta") ; this has Micro$oft error
  Else
   ShellExecute("Stripcat.exe", "baseline.dta") ; this has Micro$oft error
  EndIf
; now reverse scan...
  $DOS = Run(@ComSpec & " /k " & "ncat 192.168.1.6 80 <scanr >scanrep", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
  ProgressOn("Scanning Home", "Scan Progress ...", "Working...")
              For $i = 140 TO 0 Step -1
                ProgressSet($i)
                Sleep(100)
              Next
              ProgressSet(100, "Complete!")
              Sleep(500)
              ProgressOff()
  $DOS = Run(@ComSpec & " /k " & "ncat 192.168.1.6 80 <getdata >scan1.dta", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
  $DOS = Run(@ComSpec & " /k " & "ncat 192.168.1.6 80 <getdata >scan2.dta", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
  ShellExecute("Stripcat.exe", "scandataR.dta"); this does not have Micro$oft error
                               ; & works as expected
  If( $scanmode <> "baseline") Then
    $DOS = Run(@ComSpec & " /k " & "hbinterpret" & @CRLF, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) 
  EndIf

It did work initially. Now it errors every time. :(

Edited by fopetesl
Now fails

The most powerful number in the Universe.  Zero.

Link to comment
Share on other sites

Right, not relevant for XP.

I do find it curious that your third ShellExecute works...I would suspect Stripcat doesn't like something about the first two dta files since there is nothing intrinsically different from an AutoIt perspective about the ShellExecute function calls other than the destination file (scandataF.dta, baseline.dta, scandataR.dta).  

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...