AskThatDude Posted June 4, 2008 Share Posted June 4, 2008 Hi everyone, I am trying to pass a variable into the run command but it fails everytime. I have found other scripts in the forum that have the same feature but also fail. Was there a change made in the new AutoIT that no longer permits this? Here is an example. $Blue = "C:\Windows\Programs\testing.exe" Run($Blue) When I execute the script I get an error saying: Unable to find Run($Blue) Is there something I am missing? Thanks Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 4, 2008 Share Posted June 4, 2008 Does the program actually exist? What version of AutoIt are you using? Link to comment Share on other sites More sharing options...
AskThatDude Posted June 4, 2008 Author Share Posted June 4, 2008 Does the program actually exist? What version of AutoIt are you using?I am using 3.2.10.0The program does exist because if I just use Run("C:\Windows\Programs\testing.exe") it will work. I'm not sure what it's doing. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 4, 2008 Share Posted June 4, 2008 Wait, you wrote that it says unable to find "Run($blue)". Does it include Run in the error message? Is that the entire error, or is there more to it? Link to comment Share on other sites More sharing options...
Levenson Posted June 7, 2008 Share Posted June 7, 2008 (edited) Try to reinstall AutoIt. Edited June 7, 2008 by Levenson Link to comment Share on other sites More sharing options...
MHz Posted June 7, 2008 Share Posted June 7, 2008 ...Here is an example...Since your example is mentioned in a large scope concerning Run(), then perhaps some attempts are with paths with whitespace. Use double quotes with function call. Installed programs may require a working directory to be passed also. $file = 'testing.exe' $path = 'C:\Windows\Programs' If FileExists($path & '\' & $file) Then MsgBox(0x40000, 'Command to Run ', _ '"' & $path & '\' & $file & '"' & _ ' with the working directory of ' & $path) Run('"' & $path & '\' & $file & '"', $path) Else MsgBox(0x40000, Default, $path & '\' & $file & ' not found') EndIf 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