Solved

Can't find program in different drive!!!

Posted on 1998-11-25
1
122 Views
Last Modified: 2010-05-03
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.
0
Comment
Question by:hobster
1 Comment
 
LVL 7

Accepted Solution

by:
tward earned 0 total points
ID: 1446793
You have to specify a full path unless that file is in your path regardless of which drive it is on.

NoteTab.Exe is either in the Executables Directory that is calling it, or it is somewhere in the path that is why you do not need to specify a path.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now