gertsolo Posted November 13, 2008 Share Posted November 13, 2008 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 More sharing options...
Zedna Posted November 13, 2008 Share Posted November 13, 2008 Add testing of @error flag after Run() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
gertsolo Posted November 13, 2008 Author Share Posted November 13, 2008 (edited) Add testing of @error flag after Run()I did that, no result, it gives me nothing Edited November 13, 2008 by gertsolo The more you learn, the less you know. Link to comment Share on other sites More sharing options...
gertsolo Posted November 13, 2008 Author Share Posted November 13, 2008 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. Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 13, 2008 Share Posted November 13, 2008 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. 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 More sharing options...
heliaca Posted November 14, 2008 Share Posted November 14, 2008 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. Run(@COMSPEC & " /c " & "ipconfig /all>> kip.txt", @DesktopDir, @SW_HIDE ) Link to comment Share on other sites More sharing options...
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