Jump to content

Find an specific exe program then run it


Recommended Posts

Many Thanks Subz and Earthshine...

This code worked!:
 

;~ Check 64bit key:
Local $sFilePath = RegRead("HKLM64\Software\Microsoft\Windows\CurrentVersion\App Paths\tcw25.exe", "")
If $sFilePath = "" Then
;~ Check 32bit key :
    $sFilePath = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\tcw25.exe", "")
EndIf
If FileExists($sFilePath) = 0 Then Exit ;~ File doesn't exist.
Run($sFilePath)

 

Link to comment
Share on other sites

This is the first use of reading the Registry.... Are you saying that The install Location is better than using the App Paths??

 

TurboCAD comes in both versions 32bit and 64bit so if a user has both installed I will need to provide a switch maybe...

Link to comment
Share on other sites

I prefer using the install location because it indicates the windows thinks it’s a valid install and it probably could be repaired if it was damaged by user. But using app paths is fine or should be fine

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

"App Paths" key is generally better as it includes the full path to the exe, whereas Install Location only points to the directory the software is installed into, however like in Turbo Cad, many applications will place it in a subfolder of the Install Location.

"TurboCAD comes in both versions 32bit and 64bit so if a user has both installed I will need to provide a switch maybe.."
Another reason to use App Paths, which ever version is the default for handling TurboCad extensions this will be the one found in App Paths, only one version can be in the App Paths i.e. HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths and HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths are identical, when you add or remove a key from App Paths its replicated to the other key.  Hope that makes sense.

Link to comment
Share on other sites

either or. as long as the OP is happy. searching for the exe under the given folder is also trivial. I deal with the install locations mostly because I also test the installers and verify those keys and files are what they are supposed to be. it's not like he doesn't know where that stuff is. He should know what he tested. As noted, you can only have one version installed as the handler, 32 or 64 bit, and you should know what you installed and are testing. If you automate the installers like I do, you already KNOW where it's installed and where everything is.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

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...