Solved

The system cannot find the file specified 80070002

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

Independent Software Vendors: 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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

749 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