Jump to content
Sign in to follow this  
jrf

Running AutoIt scripts from a mapped drive

Recommended Posts

jrf

I am having a stange issue here. I have been working with some scripts that call an exe from a defines working directory. I have been running these for a couple months now with now issues. That is until someone tried to execute the script from a mapped drive vs the UNC path. I have tried everything I can think of to trouble shoot this, but it seems no matter what I do if someone has a drive mapping to a shared folder and then navigates to my scripts they fail. The error is always the same:

Line 0 (File "Y:\autoit.exe"):

Run("Setup.exe", "\\server\path")

Error: Unable to execute the external program.

The system cannot find the path specified.

Like I said before if I run this via the unc instead of Y: it works perfectly....

If someone can help or even just tell me why I would greatly appreciate it!

Share this post


Link to post
Share on other sites
Mordenkain

When I use the Run command, I can't it to work the way thw help file describes it ("filename", "dir"). But when I just use Run("full file path") it works. Dunno why the help file explains it the other way, but either its wrong, or very misleading.

Peace

- Mordenkain

Share this post


Link to post
Share on other sites
PsaltyDS

Run("Setup.exe", "\\server\path")

Error: Unable to execute the external program.

The system cannot find the path specified.

Look at the helpfile for Run(): Your line says to run Setup.exe, using \\server\path as the working directory. The parameter "workingdir" is NOT the location of the executable. If you just want to run it from the UNC, use:

Run("\\server\path\Setup.exe")oÝ÷ Øêæk&Þjëh×6Run("\\server\path\Setup.exe", @TempDir)

:shocked:


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
jrf

Thanks everyone. I kept testing it and I now have it working correctly. I was also under the impressions that the working dir was the location of the EXE but the more and more I analyzed the errors I realized that it always showed the program running from where ever I started the script. I put the full path in front of the exe and got it to work that way.

In the past I have soley used this via SMS so the exe was always in the same location as the script so it just worked.

Thanks!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.