Zag8888 Posted June 8, 2019 Share Posted June 8, 2019 Hello to all, I'm trying to run a .exe without knowing the file location; I know just the name of .exe. Is it possible to run it? Link to comment Share on other sites More sharing options...
Earthshine Posted June 8, 2019 Share Posted June 8, 2019 It might be if it is in a directory that is listed the the System Path variable. Otherwise you would have to find it before calling it My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Subz Posted June 8, 2019 Share Posted June 8, 2019 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. Earthshine and Zag8888 2 Link to comment Share on other sites More sharing options...
Exit Posted June 9, 2019 Share Posted June 9, 2019 (edited) ; 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 June 9, 2019 by Exit TheDcoder 1 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Zag8888 Posted June 9, 2019 Author Share Posted June 9, 2019 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 More sharing options...
Subz Posted June 9, 2019 Share Posted June 9, 2019 Whats the name of the application? Does it appear in Add/Remove Programs? Does it have a file extension associated to it? Zag8888 1 Link to comment Share on other sites More sharing options...
Zag8888 Posted June 9, 2019 Author Share Posted June 9, 2019 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 More sharing options...
Subz Posted June 9, 2019 Share Posted June 9, 2019 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, Zag8888 and yutijang 2 Link to comment Share on other sites More sharing options...
Zag8888 Posted June 14, 2019 Author Share Posted June 14, 2019 (edited) 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 June 14, 2019 by Zag8888 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