Jump to content
Sign in to follow this  
Clay

Help with run

Recommended Posts

Clay

Can someone please let me know why the "Run" command does not work properly if I am the executable that I am running is not in the same directory as the script thats calling the function.

More Info:

I have expanded a package and want to run the setup.exe within the folder. I use the following in my code but it does not work and I get the following message

"Please go to control panel to configure and install components"

run(@ScriptDir & "\Package\setup.exe")

but if I have the expanded file in the same directory as my script and use the following it works fine

run("setup.exe")

Should I be able to decide where and which executable I want to run?

Help please

Share this post


Link to post
Share on other sites
Richard Robertson

Try Run(@ScriptDir & "\Package\setup.exe", @ScriptDir & "\Package").

Share this post


Link to post
Share on other sites
Andreik

Or use ShellExecute() function.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
MasterX

Try Run(@ScriptDir & "\Package\setup.exe", @ScriptDir & "\Package").

A bit more extended ;)

run("setup.exe") This works because the script is in the same working dir as setup.exe

Try Run(@ScriptDir & "\Package\setup.exe", @ScriptDir & "\Package") here you set the working dir.

I think for some programs the correct working dir is needed for others not.

Share this post


Link to post
Share on other sites
Clay

Try Run(@ScriptDir & "\Package\setup.exe", @ScriptDir & "\Package").

That actually worked... thanks!!!!

Share this post


Link to post
Share on other sites
Richard Robertson

The problem then, was that it wasn't running in the directory it expected to run from.

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.