quicksilver Posted June 30, 2008 Posted June 30, 2008 Hi i've got a question. I've used the _RunDOS function with the "net use" command of windows. After some test i've got a problem. I've havent any status of the net use command. I dont know if the the command works or an error has returned. Can anyone tell me what can i do to get the return of the command?
Andreik Posted June 30, 2008 Posted June 30, 2008 Hi i've got a question. I've used the _RunDOS function with the "net use" command of windows. After some test i've got a problem. I've havent any status of the net use command. I dont know if the the command works or an error has returned. Can anyone tell me what can i do to get the return of the command? Try this: #include <Process.au3> _RunDOS("net use >C:\Log.txt") $FILE = FileOpen("C:\Log.txt",0) $LOG = FileRead($FILE) FileClose($FILE) MsgBox(-1,"NET USE",$LOG) Hope that helps!
martin Posted June 30, 2008 Posted June 30, 2008 Hi i've got a question. I've used the _RunDOS function with the "net use" command of windows. After some test i've got a problem. I've havent any status of the net use command. I dont know if the the command works or an error has returned. Can anyone tell me what can i do to get the return of the command?Here's another way adapted from th ehelp example #include <Constants.au3> While 1 $data = '' $instr = InputBox("DOS commander", "next command") If $instr = '' Then Exit Local $foo = Run("cmd.exe", @SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($foo, $instr & @CRLF);& "cat" & @CRLF & "bat" & @CRLF) ; Calling with no 2nd arg closes stream StdinWrite($foo) ; Read from child's STDOUT and show Local $data While True $data &= StdoutRead($foo) If @error Then ExitLoop Sleep(25) WEnd MsgBox(0, "DOS output", $data) WEnd Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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