Sign in to follow this  
Followers 0
gertsolo

Run command not working

6 posts in this topic

Hi,

I was running a hidden DOS command which worked fine. When I tried it on another computer nothing happend, no result no error message. So I made an easy example with the same result.

This is the command I'm testing with:

Run(@COMSPEC & " /c " & "ipconfig >> kip.txt", @SystemDir, @SW_HIDE )

They both are XP systems.

What am I missing?


The more you learn, the less you know.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Add testing of @error flag after Run()

I did that, no result, it gives me nothing

Edited by gertsolo

The more you learn, the less you know.

Share this post


Link to post
Share on other sites

I tried starting up a program (any program) from a dos box. When I do it without the @COMSPEC it works fine. As soon as want to do it hidden, it doesn't work anymore.

Very bizar.


The more you learn, the less you know.

Share this post


Link to post
Share on other sites

I tried starting up a program (any program) from a dos box. When I do it without the @COMSPEC it works fine. As soon as want to do it hidden, it doesn't work anymore.

Very bizar.

Run() is returning either an integer PID or 0. So you should be capturing and testing that return value. On failure, @error is just non-zero, so don't test for @error = 1 as it might be something else.

The working dir as @SystemDir may not be available to non-admin users. Try @TempDir instead.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Run() is returning either an integer PID or 0. So you should be capturing and testing that return value. On failure, @error is just non-zero, so don't test for @error = 1 as it might be something else.

The working dir as @SystemDir may not be available to non-admin users. Try @TempDir instead.

:mellow:

Run(@COMSPEC & " /c " & "ipconfig /all>> kip.txt", @DesktopDir, @SW_HIDE )

Share this post


Link to post
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
Sign in to follow this  
Followers 0