Jump to content

Run command not working


gertsolo
 Share

Recommended Posts

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.

Link to comment
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
Link to comment
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 )

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