Sign in to follow this  
Followers 0
johnbear

Problem with Run() - troubleshooting suggestions?

1 post in this topic

Hi guys,

We use AutoIT where I work for some internal software deployments; we have in the region of 20,000 endpoints.

I'm working with a user who is having a problem with one of our AutoIT packages. Part of what the package does is use FileInstall() to put an external tool in %temp%, run it with Run(), and read the output. Here's the code snippet around the actual running of the tool:

FileInstall("path\to\externalTool.exe", @TempDir & "\externalTool.exe", 1)
Local $PID = Run(@TempDir & "\externalTool.exe /u", @TempDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

I've cut the code down for the post, our real-world code has catches for all the standard errors. This code has worked for the last year or two across 80+ packages, including all of the test machines I have available to me for testing.

However, on this one user's machine (Windows XP SP3), the Run() command is failing. @error is set to 1, and @extended is set to 193, "Not a valid Win32 application". I put together a special troubleshooting package to help me work out what's going on with this user's machine, and here's where it get's weird: the above code fails with @extended 193, but the following code run immediately afterwards in the script works fine:

FileInstall("path\to\externalTool.exe", @TempDir & "\externalTool.exe", 1)
Local $currentDirectory = @WorkingDir
FileChangeDir(@TempDir)
Local $PID = Run("externalTool.exe /u", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
FileChangeDir($currentDirectory )

So, with the first Run() statement I get Windows error code 193, but with the second (manually changing working directory to @TempDir), the external tool runs fine. I don't think it's an AutoIT problem, as the same code runs fine on all of our test machines, and we've not had any complaints from other users, but I want to try and work out what's going on with this user's machine. Here are the other facts of the case:

  • Machine is Windows XP SP3
  • User is an administrator on the machine
  • Machine has over 100GB free on @TempDir drive
  • I've checked permissions on his @TempDir folder, nothing weird going on there
  • Copying write.exe from C:\Windows\System32 to @TempDir, it also fails to execute using code like the first snippet above
  • If I FileInstall() a batch file with "externalTool.exe /u" in it to @TempDir, and then Run() the batch file with the same code as the first snippet above, then the batch file is able to successfully run externalTool.exe (and I can read the output), even though running from AutoIT is failing with @extended 193 :unsure:
  • No log entries in user's anti-virus software client (AV software not interfering)
  • No non-company processes running on machine at time of failure

So, can anyone else think of things I can check on this user's machine that might be causing the observed behaviour? I'm getting him to run a full disk surface check at the moment in case his @TempDir is stored on a damaged part of the disk, but I don't know why that would cause one Run() statement to fail and the other to succeed?

Cheers!

John

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