Jump to content

no output from run command


hellAT
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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 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.
  :)

Link to comment
Share on other sites

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?
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...