Jump to content

How to run an .exe without knowing the file location?


Recommended Posts

Or has an "App Path" value HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths.  The easiest way to test if an executable can be run is to use the following:

Click: Start + Run or Windows Key + R and type the name of the executable, if it runs then it doesn't require a path.

If it fails, you might be able to get the file path via registry (if it's an installed software product), just search through registry for .exe and try and find a common key that all machines would use.

Link to comment
Share on other sites

; Display EXE names location

$sExename = InputBox("", "Enter EXE name.", "Autoit3")

Send("#r")
Sleep(500)
Send("cmd{ENTER}")
Sleep(500)
Send("dir c:\" & $sExename & ".exe /s /b{ENTER}")
Sleep(500)
MsgBox(64 + 262144, Default, "Press OK to exit.", 0)
Send("Exit{ENTER}")
; end of scipt

 

Edited by Exit

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

10 hours ago, Subz said:

Or has an "App Path" value HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths.  The easiest way to test if an executable can be run is to use the following:

Click: Start + Run or Windows Key + R and type the name of the executable, if it runs then it doesn't require a path.

If it fails, you might be able to get the file path via registry (if it's an installed software product), just search through registry for .exe and try and find a common key that all machines would use.

Tried to search via registry, how can I find a common key?

Link to comment
Share on other sites

13 minutes ago, Subz said:

Whats the name of the application?  Does it appear in Add/Remove Programs?  Does it have a file extension associated to it?

Yes, it appears in Add/Remove Programs, It doesn't have any extensions associated to it.

Link to comment
Share on other sites

So the software should appear in either 32bit or 64bit key

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

You should be able to use the InstallPath (not always set) or UninstallString to get the path of your file,

Link to comment
Share on other sites

On 6/9/2019 at 2:22 PM, Subz said:

So the software should appear in either 32bit or 64bit key

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall 
  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

You should be able to use the InstallPath (not always set) or UninstallString to get the path of your file,

 

Found it in HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Edit: Works perfect using regread, thanks a lot for the help :)

Edited by Zag8888
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...