Jump to content

runwait not behavioring as expected


mschol
 Share

Recommended Posts

i want to call a program with a few parameters and time the total execution time:

#include <Timers.au3>
$file = FileOpen("time.txt",2)
MsgBox(0,'','g:\filelist.exe /MD5 /SHA256 H:\ /S >> fileList_H_'&@MDAY&'-'&@MON&'-'&@HOUR&@MIN&'.csv');
$starttime = _Timer_Init()
RunWait('g:\filelist.exe /MD5 /SHA256 H:\ /S  fileList_H_'&@MDAY&'-'&@MON&'-'&@HOUR&@MIN&'.csv')
FileWriteLine($file,_Timer_Diff($starttime))
FileClose($file)

Exit

filelist.exe is a freeware util from JAM software readme

in the above code i will always get the output on screen..

the /S parameter is undocumented but does work

if i execute the command in a command line interface the output gets redirected to the specified file, but i cannot seem to get autoit to do the same...

anyone who can help me?

Edited by mschol
Link to comment
Share on other sites

  • Developers

Try using @COMSPEC to shell the program or ShellExecute() ?

something like (untested)

RunWait(@comspec & '/c g:\filelist.exe /MD5 /SHA256 H:\ /S  fileList_H_'&@MDAY&'-'&@MON&'-'&@HOUR&@MIN&'.csv')

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Try using @COMSPEC to shell the program or ShellExecute() ?

something like (untested)

RunWait(@comspec & '/c g:\filelist.exe /MD5 /SHA256 H:\ /S  fileList_H_'&@MDAY&'-'&@MON&'-'&@HOUR&@MIN&'.csv')

that worked, i missed a > before the filename but that was everything ;)

thanks :)

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...