Solved

Can't find program in different drive!!!

Posted on 1998-11-25
1
127 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month5 days, 20 hours left to enroll

627 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