tricky808 Posted August 19, 2004 Posted August 19, 2004 I'm using scanreg.exe (from Win2K Res Kit) to search the registry for keywords and dump the information into a file that I parse at a later time. Here is the code: FileInstall("scanreg.exe","scanreg.exe") $shortPathScanReg = FileGetShortName(@ScriptDir & "\scanreg.exe") $hiveRoot = StringSplit("HKEY_LOCAL_MACHINE,HKEY_CLASSES_ROOT,HKEY_CURRENT_USER,HKEY_USERS",",") For $h = 1 to 4 $returnCode = RunWait(@ComSpec & " /c " chr(34) & $shortPathScanReg & " /s " & $searchString & " /r " & $hiveRoot[$h] & " -kvd >C:\test\regFile.txt" & chr(34),"",@SW_HIDE) MsgBox(0,"returnCode",$returnCode) Next So when I run the command line from a console window, it runs and dumps the regscan stream into c:\test\regFile.txt. But no such luck when I fire the RunWait command from the autoit script. returnCode responds with error 1: incorrect function. So what gives? TIA Aut viam inveniam aut faciam
CyberSlug Posted August 19, 2004 Posted August 19, 2004 $returnCode = RunWait(@ComSpec & " /c " & chr(34) ...I lost count the number of times I make this mistake Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
tricky808 Posted August 20, 2004 Author Posted August 20, 2004 $returnCode = RunWait(@ComSpec & " /c " & chr(34) ... I lost count the number of times I make this mistake <{POST_SNAPBACK}>Thanks for the reply. My problem was actually due to a previous FileOpen call without performing a FileClose before piping my command-line into it. But good catch nonetheless. Aut viam inveniam aut faciam
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