therks Posted December 21, 2004 Share Posted December 21, 2004 As most of us know, the easiest way to launch a file that isn't an exe is to use @ComSpec with the Start command. One thing I've been curious about though, is that if the path I'm trying to run has a space in it, I must enclose it with quotation marks (duh), the problem is, the way my Start acts (WinXP) is that if the first parameter is enclosed in quotes, it sets it as the title of the window. So if I want to launch something with spaces in the filename, I actually have to do something like this: Run(@ComSpec & ' /c start "" "C:\Program Files\File.txt"') Now, this doesn't bother me much (except it makes a bit of hassle for portability, 98's doesn't respond the same as XP, and I don't even know about ME or 2K), but I finally decided I had to ask why I haven't seen anybody else having to make up for this "bug" (or is it feature? heh) of the Start command. Am I the only one afflicted with this problem? Or am I just unobservant? Sorry if this doesn't belong here, I was going to post it in the Chat forum, but I figure it IS AutoIt related.. in a way. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
MHz Posted December 21, 2004 Share Posted December 21, 2004 As most of us know, the easiest way to launch a file that isn't an exe is to use @ComSpec with the Start command. Run(@ComSpec & ' /c start "" "C:\Program Files\File.txt"')This is how I would run it.Run(@ComSpec & ' /c "C:\Program Files\File.txt"')I use Start for executables etc. Not for documents. Comspec will search the registry for the program, to suit the extension. If you have an executable or application, then the purpose of using Start is so you can use it's switches like Start /Wait. If you wanted to use Start in your command above. You would have to call a application like Notepad. Example:Run(@ComSpec & ' /c start Notepad.exe "C:\Program Files\File.txt"') Link to comment Share on other sites More sharing options...
this-is-me Posted December 21, 2004 Share Posted December 21, 2004 Look for the shellexecute UDF in these forums. That is the autoit-only method of correctly running a file. Who else would I be? Link to comment Share on other sites More sharing options...
therks Posted December 25, 2004 Author Share Posted December 25, 2004 Heh, funny, I threw 'shellexecute' into the search and only came up with you post at first. Needed to expand my searching field. My AutoIt Stuff | My Github 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