Clay Posted August 25, 2008 Share Posted August 25, 2008 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 Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 25, 2008 Share Posted August 25, 2008 Try Run(@ScriptDir & "\Package\setup.exe", @ScriptDir & "\Package"). Link to comment Share on other sites More sharing options...
Andreik Posted August 25, 2008 Share Posted August 25, 2008 Or use ShellExecute() function. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
MasterX Posted August 25, 2008 Share Posted August 25, 2008 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.exeTry 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. Link to comment Share on other sites More sharing options...
Clay Posted August 25, 2008 Author Share Posted August 25, 2008 Try Run(@ScriptDir & "\Package\setup.exe", @ScriptDir & "\Package").That actually worked... thanks!!!! Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 25, 2008 Share Posted August 25, 2008 The problem then, was that it wasn't running in the directory it expected to run from. 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