This has got to be so blindingly obvious that I just can't see it. How do I launch an executable (say, winword.exe) from the user's hard drive? I looked all through the trial version's help and searched this forum. I've tried file_execute and file_open with no luck. I tried using %windrv% and %sysdrv% as variables. I can launch "foo.exe" if it resides on the CD, or I can launch "foo.doc" if it resides on the CD, which seems to invoke the user's installed copy of Word. What am I missing?
Announcement
Collapse
No announcement yet.
Launching an executable from the user's hard drive
Collapse
X
-
Re: Launching an executable from the user's hard drive
Yes FILE > EXECUTE will work if you are seeking to execute an executable file. Makes no difference what drive the .exe is on as long as your path is correct. Try again, should work...
Corey Milner
Creative Director, Indigo Rose Software
Comment
-
Re: Launching an executable from the user's hard drive
If you want to launch an executable, you're better off using File - Execute because it gives you a bit more control (such as the ability to pass command line arguments).
File - Open is just like double-clicking on a file in Windows. If the file has an extension that is associated with a program (e.g. .doc with Word, .txt with Notepad, .mp3 with Winamp, etc.), then Windows will launch the associated program and use it on the file.
If you want to launch a program, you need to tell the action where that program is. You could provide a full path like "C:\WINNT\System\Write.exe", but what if the user has their operating system installed somewhere else? For instance, if they're running Windows 98 or XP, that would probably need to be C:\Windows instead of C:\WINNT...or maybe something else entirely like C:\EVERYOSSUCKS.
This is where built-in variables come in. AutoPlay provides a whole bunch of built-in variables for common paths...the program will figure out where the user's common folders (like Windows, System, My Documents, and Program Files) are located, and then store the path to each one in a different built-in variable. Just substitute the variable for the part of the path that it represents, like so:
%system%\Write.exe
You can find a list of these built-in variables in the online help file.--[[ Indigo Rose Software Developer ]]
Comment
-
Re: Launching an executable from the user's hard drive
Thanks all. I was hoping not to have to know the fully-qualified or UNC path. %ProgramFiles% works as far as it goes, but you still need to know the file structure under that. I was hoping for something like Window's Start|Run, which doesn't need the full path. No big deal, though.
Comment
-
Re: Launching an executable from the user's hard drive
Try using the Read Registry value action for LOCALMACHINE\Software\Microsoft\Windows\CurrentVer sion\App Paths\Winword.exe into a variable say %WinPath%
Then File Execute %WinPath%/winword.exe
Comment
Comment