fred666777 Posted August 6, 2007 Posted August 6, 2007 i can get _RunDOS to work with one lines commands like ipconfig/all but how would i get it to work when you need multiple lines of script? for example if i wanted to send ipconfig then send ipconfig/all
tAKTelapis Posted August 6, 2007 Posted August 6, 2007 _RunDos("ipconfig") _RunDos("ipconfig /all") ??
Gif Posted August 6, 2007 Posted August 6, 2007 i dont quite understand you but if you want to send 2 commands then:#include <process.au3> _RunDOS('ipconfigl') sleep(200) _RunDOS('ipconfig /all') exitoÝ÷ ÛöÛºÛaÌ"W(ë©Â+aax"*.Á©í¶¶Ø^ë.Ú¶,yÊ&©Ý³*.ë-ºÇØ^+]¢ëe¢¶¥¥ø¥zåG«[jëh×6Run(@ComSpec & " /C ipconfig /all > "&@tempdir &'\tempipconfig.txt', "", @SW_HIDE) $read = FileRead(@tempdir &'\tempipconfig.txt') msgbox(0, "", $read) exitthen play with strings to get the results you want
MHz Posted August 6, 2007 Posted August 6, 2007 Multiple commands inline. RunWait('"' & @ComSpec & '" /c ipconfig & ipconfig /all & pause') Character: & Syntax: command1 & command2 Definition: Use to separate multiple commands on one command line. Cmd.exe runs the first command, and then the second command. Character: && Syntax: command1 && command2 Definition: Use to run the command following && only if the command preceding the symbol is successful. Cmd.exe runs the first command, and then runs the second command only if the first command completed successfully. Character: || Syntax: command1 || command2 Definition: Use to run the command following || only if the command preceding || fails. Cmd.exe runs the first command, and then runs the second command only if the first command did not complete successfully (receives an error code greater than zero). Character: ( ) Syntax: (command1 & command2) Definition: Use to group or nest multiple commands.
fred666777 Posted August 6, 2007 Author Posted August 6, 2007 im not sure if any of these are the right answer but i didnt explain that well waht i ment was it to type something like ...doesnt have to be but just for the sake of it i want to type ipconfig then a short pause then ipconfig/all. i dont want to run them at 2 separate times. so it would basiclly be like opening a cmd prompt and typing ipconfig then hit enter then type ipconfig/all then hit enter again its in the same window but at diff times so is it like _rundos(ipconfig & ipconfig/all) or so is it like _rundos(ipconfig) _rundos(ipconfig/all) ... i dont think im making any sense...
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