Guest bobele Posted July 20, 2004 Share Posted July 20, 2004 Hello I'm trying to run the following script: #---------START SCRIPT--------------------------------------------------- dim dir ; usually, the %appdir% enviroment varialbe has a value of c:\program files\app 1\ $dir = EnvGet("APPDIR") Run($dir\setup.exe) #-----------END SCRIPT-------------------------------------------------- First Problem: The run function does not start the setup exe, neither if I wrote: - Run("$dir\setup.exe") (ok, it is not a string, but the $dir variable should be substituted), nor - Run($dir\setup.exe) (it seems that it does not substitute the variable) Second Problem I have to put "" around the $dir variable, if not the run function would not be able to find the setup. I cannot change the value of the $dir variable, because she is taken over from a common setup.exe, where it is not possible to put double quotes around the path. How can I start this setup.exe with a variable path? Thank you Bobele Link to comment Share on other sites More sharing options...
this-is-me Posted July 20, 2004 Share Posted July 20, 2004 Run($dir & "\setup.exe") Who else would I be? Link to comment Share on other sites More sharing options...
Guest bobele Posted July 20, 2004 Share Posted July 20, 2004 Thank you this-is-me Cool, so easy. But how do I put double quotes around the value of the $dir variable? Many thanks bobele Link to comment Share on other sites More sharing options...
emmanuel Posted July 20, 2004 Share Posted July 20, 2004 check out FAQ #7, I think that's the one that covers &. Run('"' & $dir & "\setup.exe" & '"') will put quotes around the whole string. "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Davman Posted July 20, 2004 Share Posted July 20, 2004 alternatively, edit the $dir string and add some double quotes to the beginning and end. Sitting comfortably behind the code. Link to comment Share on other sites More sharing options...
emmanuel Posted July 20, 2004 Share Posted July 20, 2004 alternatively, edit the $dir string and add some double quotes to the beginning and end.yes, but really, you want quotes around the whole thing, including the exe, for windows to like it. if you wanted to do it with command line options, here's how I'd do it: Run('"' & $dir & "\setup.exe" & '" /a/b/c some option') which would be passed to windows as: "c:\program files\app 1\\setup.exe" /a/b/c some option PS, I noticed that your env var has a trailing backslash, so you would probably want to either edit the returned variable, or just not add it before setup.exe. "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Davman Posted July 20, 2004 Share Posted July 20, 2004 hmm.. windoze just sucks like that... *goes to play with a real operating system* *plays pong* Sitting comfortably behind the code. Link to comment Share on other sites More sharing options...
SlimShady Posted July 20, 2004 Share Posted July 20, 2004 check out FAQ #7, I think that's the one that covers &. Run('"' & $dir & "\setup.exe" & '"') will put quotes around the whole string.Here's a smaller version: Run('"' & $dir & '\setup.exe"') Link to comment Share on other sites More sharing options...
emmanuel Posted July 20, 2004 Share Posted July 20, 2004 'course, plenty of ways to make it shorter... my way does make it easier to throw a variable in for setup.exe also just illustrates possibilities. "I'm not even supposed to be here today!" -Dante (Hicks) 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