?
Solved

The system cannot find the file specified 80070002

Posted on 2004-08-17
4
Medium Priority
?
6,285 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 250 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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 1 hour left to enroll

770 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