Iraj Posted February 27, 2022 Posted February 27, 2022 Hi Team, Greetings! One silly doubt, I need to pass one parameter using RunWait to write an output to a file using Cmd Line, but the below isn't writing to the file specified. Kindly assist. $pass = $CmdLine[1] $CMD = "C:\Progra~1\bin\Encrypt.exe" &$pass& " > C:\temp\pwd.txt" #write the parameter $pass in C:\temp\pwd.txt RunWait(@ComSpec & " /c " & $CMD,"",@SW_HIDE) Thank you!!
Gianni Posted February 27, 2022 Posted February 27, 2022 probably a space is missing after Encrypt.exe and before the quotes and a semicolon is also missing after pwd.txt " Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Developers Jos Posted February 27, 2022 Developers Posted February 27, 2022 (edited) .. and probably need to use @ComSpec to be able to pipe the output? EDIT: is there already so ignore this comment. Edited February 27, 2022 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.
Iraj Posted February 27, 2022 Author Posted February 27, 2022 3 minutes ago, Gianni said: probably a space is missing after Encrypt.exe and before the quotes and a semicolon is also missing after pwd.txt " I already tried giving space, but no luck. The semicolon is not required at the end I suppose.
Developers Jos Posted February 27, 2022 Developers Posted February 27, 2022 Is this an x64 program you are trying to run ? 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.
Gianni Posted February 27, 2022 Posted February 27, 2022 18 minutes ago, Iraj said: ... The semicolon is not required at the end I suppose. wrong, as it is you generate an error put a semicolon here; ... pwd.txt " ; #write .... Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Trong Posted March 5, 2022 Posted March 5, 2022 Change and experiment with the following commands: Global $Pass_Encrypt = $CmdLine[1] Global $Encrypt_exe = 'C:\Progra~1\bin\Encrypt.exe' Global $OUT_pwd_txt = 'C:\temp\pwd.txt' FileDelete($OUT_pwd_txt) Local $CMD = '"' & $Encrypt_exe & '" "' & $Pass_Encrypt & '" > "' & $OUT_pwd_txt & '"' ; #write the parameter $pass in C:\temp\pwd.txt If Not FileExists($Encrypt_exe) Then Exit ConsoleWrite('! ERROR File not Exists: ' & $Encrypt_exe & @CRLF) RunWait(@ComSpec & ' /c ' & $CMD, "", @SW_HIDE) If FileExists($OUT_pwd_txt) Then ConsoleWrite('- Input: ' & $Pass_Encrypt & @CRLF & '- Output: ' & FileRead($OUT_pwd_txt) & @CRLF) Enjoy my work? Buy me a 🍻 or tip via ❤️ PayPal
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