singbass Posted June 7, 2005 Posted June 7, 2005 On my Windows XP machine, I can go to the run command and type 'winword' and hit enter, and Word will open. I assume this is because the folder where the executable resides, is in the 'path' variable on the PC. When I try and run Word using the RUN("winword.exe") command, it doesn't work, but if I use the entire path like Run("c:\program files\microsoft office\office10\winword.exe"), it works just fine. Is there a way around this? I would like to write a script that will run on any PC that has Word loaded, but I can't guarantee that the executable is in the same location on every PC.
Valuater Posted June 7, 2005 Posted June 7, 2005 3 ideas 1 check all known locations If FileExists(@ProgramFilesDir & "\microsoft office\office10\winword.exe") Then Run(@ProgramFilesDir & "\microsoft office\office10\winword.exe") and other known locations 2 Run(@ComSpec & " /C START winword.exe", "", @SW_MINIMIZE) ;or maximized Sorry forgot the 3rd idea hope it helps.......
DaveF Posted June 8, 2005 Posted June 8, 2005 If you look at the Default value at the registry key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe...you'll get the short path the the Word executable. Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.
CyberSlug Posted June 8, 2005 Posted June 8, 2005 For what it's worth, things like "winword" and "msconfig" don't work at the command prompt either. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
singbass Posted June 9, 2005 Author Posted June 9, 2005 Command Run(@ComSpec & " /C START winword.exe", "", @SW_MAXIMIZE) worked great! Thanks.
/dev/null Posted June 9, 2005 Posted June 9, 2005 (edited) Command Run(@ComSpec & " /C STARTÂ winword.exe", "", @SW_MAXIMIZE) workedthat's because launching a command from cmd.exe just by typing the name, will only search the application in the env variable %path%, while start will also search the registry for the application. As DaveF already posted, this is found in:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App PathsCheersKurt Edited June 9, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
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