Solved

The system cannot find the file specified 80070002

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

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

705 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

18 Experts available now in Live!

Get 1:1 Help Now