Bob Wya Posted February 3, 2008 Share Posted February 3, 2008 I am trying to call the Rehash utility under Windows XP Pro:Rehash UtilityWhen I call this command in command window it works fine:C:\███\███\███\███\███\███\> "C:\Program Files (x86)\Rehash\rehash.exe" -none -crc32 -tiger "██████████.avi" > "temp.txt"I have set up the working directory correctly... Any thoughts what could be going wrong?? I get an error code 3 when Itry and run the script and it exits straight away...Doesn't workRedirecting to a file does not work in an AutoIt script but does from a command window.CODEConst $c_rehash_executable_path_default = "C:\Program Files (x86)\Rehash\rehash.exe"Global $s_hash_path, $s_hash_folder, $s_hash_fileGlobal $gs_temp_hash_fileGlobal $return_code$s_hash_folder = "C:\███\███\███\███\███\███\"$s_hash_file = "███.avi"$s_hash_path = $s_hash_folder & $s_hash_file$gs_temp_hash_file = "temp.txt"$return_code = RunWait ("""" & $c_rehash_executable_path_default & """ -none -crc32 -tiger """ & $s_hash_file & """ > """ & $gs_temp_hash_file & """" , $s_hash_folder, @SW_HIDE)ConsoleWrite("return code = " & $return_code & @CRLF)ConsoleWrite(FileRead($gs_temp_hash_file) & @CRLF)ExitWorksI don't really want to use an AutoIt script wrapper for the Rehash process but this does work!CODE#include <Constants.au3>Const $c_rehash_executable_path_default = "C:\Program Files (x86)\Rehash\rehash.exe"Global $s_hash_path, $s_hash_folder, $s_hash_fileGlobal $output_streamGlobal $gpid_rehash$gpid_rehash = 0$s_hash_folder = "C:\███\███\███\███\███\███\"$s_hash_file = "███.avi"$s_hash_path = $s_hash_folder & $s_hash_file$gpid_rehash = Run("""" & $c_rehash_executable_path_default & """ -none -crc32 -tiger """ & $s_hash_file & """", $s_hash_folder, @SW_HIDE, $STDOUT_CHILD)While ProcessExists($gpid_rehash) Sleep(1000)WEnd$output_stream = StdoutRead($gpid_rehash)ConsoleWrite($output_stream & @CRLF)Exit Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2008 Developers Share Posted February 3, 2008 what about this version ?: $return_code = RunWait(@ComSpec & ' /c "' & $c_rehash_executable_path_default & '" -none -crc32 -tiger "' & $s_hash_file & '" > "' & $gs_temp_hash_file & '"', $s_hash_folder, @SW_HIDE) 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 More sharing options...
Bob Wya Posted February 3, 2008 Author Share Posted February 3, 2008 what about this version ?: $return_code = RunWait(@ComSpec & ' /c "' & $c_rehash_executable_path_default & '" -none -crc32 -tiger "' & $s_hash_file & '" > "' & $gs_temp_hash_file & '"', $s_hash_folder, @SW_HIDE) Thanks but... No that that form is only for executing commands built into the DOS shell. The Rehash command is like any installed executable (just happens not have a GUI). Its wierd that it works in an AutoIt script except when I use the command option to output to a file... Bob Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2008 Developers Share Posted February 3, 2008 (edited) Thanks but...No that that form is only for executing commands built into the DOS shell. The Rehash command is like any installed executable (just happens not have a GUI).Its wierd that it works in an AutoIt script except when I use the command option to output to a file...BobAFAIK the PIPE ">" function is a function of the CMD shell so I expect you require that to make the ">" work.I have reread your initial post and am kinda lost on what format you are really looking for now. Do you want to use the PIPE to file of do you want to use the Build-in STDIO functionality ? Edited February 3, 2008 by Jos 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now