nicky40 Posted December 12, 2008 Share Posted December 12, 2008 Hey all, I know I don't post at all, but that's because my knowledge isn't really as developed as most of yours. My question is how would I find out what the .exe path of MS word is? I understand that notepad would open with the command Run("notepad.exe") But I can't seem to use any tool to figure out what I would replace notepad with for it to work with Word. Thanks in advance, Nicholas Link to comment Share on other sites More sharing options...
Marlo Posted December 12, 2008 Share Posted December 12, 2008 I suppose you could use the windows registry to locate MS Word. Im afraid i dont know what the Key is though as i dont have word on this laptop =( But when you do get hold of the reg key just use the RegRead() function to get the value Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
nicky40 Posted December 12, 2008 Author Share Posted December 12, 2008 I suppose you could use the windows registry to locate MS Word. Im afraid i dont know what the Key is though as i dont have word on this laptop =(But when you do get hold of the reg key just use the RegRead() function to get the value Do you mind guiding me through using the windows registry? I'm trying to google it and find out on my own, but I don't want to take any chances. Thanks,Nicholas Link to comment Share on other sites More sharing options...
nicky40 Posted December 12, 2008 Author Share Posted December 12, 2008 UPDATE! I'm digging around through my regedit and I've found Word, but I'm unsure what to do now. Thanks, Nick Link to comment Share on other sites More sharing options...
cmattb Posted December 13, 2008 Share Posted December 13, 2008 You don't need to dig around in the registry for that. If you have Word in your start-menu, just highlite it, right-click and select properties. Whatever is in the Target field is the path to MS word. Just stick that in the Run() and you're good to go. If its not there, dig around in you Progam Files directory. You could also do a search for "word.exe" using windows search. A bit more information than you asked for, but Run() works with just "notepad.exe" since notepad is based in the System32 folder of windows. Any command in DOS or autoit can automatically execute any program in that folder. For any other progam you want to run, you need to give it the full path. Link to comment Share on other sites More sharing options...
BrettF Posted December 13, 2008 Share Posted December 13, 2008 (edited) Hi check this out: If @ProcessorArch = "X64" Then $Basepath = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe", "Path") & "winword.exe" Else $Basepath = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe", "Path") & "winword.exe" EndIf MsgBox (0, @ProcessorArch, "Running MS Word using registry entry. Location is: '" & $Basepath & "'") Run ($Basepath) MsgBox (0, "", "Now running it using ShellExecute()") ShellExecute ("winword.exe") EDIT: Or... If @ProcessorArch = "X64" Then $Basepath = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe", "") Else $Basepath = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe", "") EndIf MsgBox (0, @ProcessorArch, "Running MS Word using registry entry. Location is: '" & $Basepath & "'") Run ($Basepath) Cheers, Brett Edited December 13, 2008 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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