Jump to content

Recommended Posts

Posted (edited)

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
  • Developers
Posted

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

Posted

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

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
  • Recently Browsing   0 members

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