Private Sub Command1_Click()
Shell ("cmd.exe")
End Sub

Private Sub Command2_Click()
Shell ("calc.exe")
End Sub

Private Sub Command3_Click()
Shell ("explorer.exe")
End Sub

Private Sub Command4_Click()
Shell "winver.exe"
End Sub

Private Sub Command5_Click()
Shell "C:\Program Files\Windows Media Player\wmplayer.exe"
End Sub

above code is able to open the pre-installed windows programs. But now i want my program to have a button which could be able to open the program without providing the full installed directory path, i.e, automatically search for the app and open it.
e.g.: Instead of writing "C:\Program Files\Windows Media Player\wmplayer.exe", i want to write only "wmplayer.exe" or "vlc.exe"...

4 Years
Discussion Span
Last Post by Assembly Guy

It would have to be in your %PATH% environment variable. You can set this manually, per application. For example, you'd need to add C:\Program Files\Windows Media Player\, and the directories where any executable you wish to use in this manner, to the path variable

Edited by Assembly Guy

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.