hellAT Posted December 7, 2007 Posted December 7, 2007 Hello, i have a strange problem. Several PC are running a script where i use "ipconfig /all" to get some in. My original script looks like this: $stream = Run(@ComSpec & " /c ipconfig /all", '', @SW_HIDE, 2) While 1 $line = StdoutRead($stream) $cmdreturn &= $line If @error Then ExitLoop WEnd On two PCs i do not get any result, means $cmdreturn="" So does someone have an idea why the return value is empty?!? For me, it seems that all PCs are installed in the same way (WinXp Prof, same patchlevel etc). If i open an DOS Box and run "cmd /c ipconfig /all" it looks fine. thanks in advance / karsten
Developers Jos Posted December 8, 2007 Developers Posted December 8, 2007 (edited) Your error test is at the wrong place: $cmdreturn="" $stream = Run(@ComSpec & " /c ipconfig /all", '', @SW_HIDE, 2) while 1 $line = StdoutRead($stream) If @error Then ExitLoop $cmdreturn &= $line WEnd ConsoleWrite('@@ (9) $cmdreturn = ' & $cmdreturn & @CRLF);### Debug Console Not sure if thats the real problem, you could also capture the STDERR to see if there is any error message displayed.... Edited December 8, 2007 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.
hellAT Posted December 10, 2007 Author Posted December 10, 2007 Have you included Constants.au3?in script its there, yes. But where do you see the need in this small example?
hellAT Posted December 10, 2007 Author Posted December 10, 2007 Your error test is at the wrong place: $cmdreturn="" $stream = Run(@ComSpec & " /c ipconfig /all", '', @SW_HIDE, 2) while 1 $line = StdoutRead($stream) If @error Then ExitLoop $cmdreturn &= $line WEnd ConsoleWrite('@@ (9) $cmdreturn = ' & $cmdreturn & @CRLF);### Debug Console Not sure if thats the real problem, you could also capture the STDERR to see if there is any error message displayed.... A short question to ConsoleWrite. My way is to compile the script and then send the exe to the User by mail. Is there a way, to direct the Output to textfile or Popup?
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