Solved

Can't find program in different drive!!!

Posted on 1998-11-25
1
121 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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