Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can't find program in different drive!!!

Posted on 1998-11-25
1
Medium Priority
?
129 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 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…
Suggested Courses

730 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