Jump to content
Sign in to follow this  

how to launch the script from target program location?

Recommended Posts


I am automating an installer, but having a problem due to relative address.

The installer I am automating is in D:\ drive. But the script is located in C:\ drive. The installer use relative path to locate some file, which caused the problem. If I manually click on the installer on D:\ drive, all relative path works fine. But since the script is in C:\, at some point this logic breaks.

Here is an example, on cmd:

d:\installer.exe (this works, as it launched from native location)

c:\d:\installer.exe (this still can launch the installer, but due to a different launch location, some part of the logic will break)

Is there a way to let the script run from the same path as installer? Since this installer is on a CD, I cannot put the exe to that location.

Thanks for the help.

Edited by h711

Share this post

Link to post
Share on other sites
Richard Robertson

Change the working directory.

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.