Link to home
Start Free TrialLog in
Avatar of hobster
hobster

asked on

Can't find program in different drive!!!

I have a vb program which starts up another windows program. In the code below, I'm starting notepad.

Private Sub cmdStartProgram_Click()
   Dim RetVal As Variant  
   RetVal = Shell("NoteTab.exe", 1)                
End Sub

This works. The notepad.exe file is in the C drive. However, if I call another program from another drive (like the D, E, or F drive) without specifying the full path name to that file, I get an error.

How do I fix this, without hardcoding the full pathname into the code? Thanks.
ASKER CERTIFIED SOLUTION
Avatar of tward
tward

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial