Solved

The system cannot find the file specified 80070002

Posted on 2004-08-17
4
6,266 Views
Last Modified: 2012-05-05
The problem arises on the "WshShell.Run custominst" line.  H: is a network drive mapped earlier in the script.  I have tried Epic2002_Custom and Epic2002_Custom.EXE as the executable name, both stating that the system cannot find the file specified.  I'm sure it's just something with my syntax, but nonetheless I havent figured it out.

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim custominst
custominst = ("H:\Epic Summer 2004\epicinstall2004\Epic2002_Custom")
WshShell.Run custominst
WScript.Quit
0
Comment
Question by:RussoMA
[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
  • 2
4 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 125 total points
ID: 11824256
Try this


custominst = "H:\Epic Summer 2004\epicinstall2004\Epic2002_Custom"


instead of


custominst = ("H:\Epic Summer 2004\epicinstall2004\Epic2002_Custom")
0
 
LVL 8

Expert Comment

by:ampapa
ID: 11824291
Are you sure your mapping took for the H: drive?
0
 

Author Comment

by:RussoMA
ID: 11824302
same error, actually i had the parenthesis around it because i thought it might have had something to do with the spaces in the path, so i was doing goofy stuff like:

custominst = ("h:\Epic" & " " & "Summer" & " " & "2004\epicinstall2004\Epic2002_Custom")

in hopes that it might have been that.  Unless I was still keeping the spacing problem?

Wait, that just made me think.  i added this:


Dim quote
quote = Chr(34)

WshShell.Run quote & custominst & quote

and it worked!
0
 

Author Comment

by:RussoMA
ID: 11824312
I gave the points to EDDY because he made me rethink my spacing issue.

it was interpreting the file to be h:\Epic and that was all...
0

Featured Post

Industry Leaders: 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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 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…

689 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