Sign in to follow this  
Followers 0
l3ill

Find Full Path to an unused Program

2 posts in this topic

Hi,

  Trying to to find a way to get the full path to a programs executable with that program not running.

I have searched the Help File and forums and have not been able to find a way that works the same every time.

This works but only on some programs: >_GetInstalledPath ( I got this to find the full path to Irfan View's exe by only using "iview", "Irfan" as the criteria, strangely enough it only worked on that one program. )

>This works too but only if you know the exact name of the exe. And in this same thread >this was mentioned which leads me to believe that there is an easier more foolproof way.

  With all the WinApi Path modules, I cant believe there isn't one that does this... :(

Thanks in advance for any pointers.

Bill

Share this post


Link to post
Share on other sites



You can arrange the code from your 2nd link
This one returns the path for all the exe which name includes the word 'autoit'

#include <Constants.au3>
$sDriveToSearch = "C:\"
$sAppToFind = "autoit"
Local $foo = Run(@ComSpec & ' /c dir "' & $sDriveToSearch & '"' & '*.exe /s/b', "", @SW_HIDE, $STDOUT_CHILD)
Local $line, $path
While 1
    $line = StdoutRead($foo)
    If @error Then ExitLoop
    If StringInStr(StringRegExpReplace($line, '.+\\(.+)', "$1"), $sAppToFind) Then $path &= StringStripWS($line, 3) & @CRLF
WEnd
Msgbox(0,"", $path)
;ConsoleWrite($path & @CRLF)

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