0

I can open EXE using following way. But sometimes, path is not fixed. If user change the installation path, following code will be useless.

Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Exec("C:\Program Files (x86)\MyAppFolder\MyApp.exe") 
Set objShell = Nothing

I have referred following links as suggested

1- Launch programs whose path contains spaces : But this suggest using path or using Run. In my case path is not fixed. User is free to install application anywhere. I have tried using Run as given in that link but my application doesn't open from Run as example suggests

2- How to get program files environment setting from VBScript : This link also contains some solution to get Program File path. But as I said above user is free to install anywhere.

Please suggest how to open EXE if path is not predecided.

9
  • This question is unanswerable as stated. If you don't know the path of the EXE what do you know? Commented Oct 4, 2016 at 9:38
  • @MargaretBloom If the system is 32 Bit, there is no Program Files (x86) folder, else there will be. How to manage in this situation?? There must be some way. Commented Oct 4, 2016 at 9:39
  • Possible duplicate of Launch programs whose path contains spaces Commented Oct 4, 2016 at 9:40
  • Answered here: stackoverflow.com/a/1891302/603855 Commented Oct 4, 2016 at 9:41
  • 1
    Search for the file, obviously. Commented Oct 4, 2016 at 10:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.