Solved

The system cannot find the file specified 80070002

Posted on 2004-08-17
4
6,247 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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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

829 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