Jump to content

I'm a n00b, please help!


nicky40
 Share

Recommended Posts

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

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

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

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 by BrettF
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...