Sign in to follow this  
Followers 0
nicky40

I'm a n00b, please help!

6 posts in this topic

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

Share this post


Link to post
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 :)


Click here for the best AutoIt help possible.Currently Working on: Autoit RAT

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

UPDATE!

I'm digging around through my regedit and I've found Word, but I'm unsure what to do now.

Thanks,

Nick

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by BrettF

Share this post


Link to post
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
Sign in to follow this  
Followers 0