Solved

Visual basic command includes a <space>

Posted on 2009-05-04
2
250 Views
Last Modified: 2013-11-25
I have the following line of code in a VBS script.

       WshShell.Run """c:\perl2.exe W_router.pl"""

The script host error is "file not found".

This command run as:

       c:\perl2.exe W_router.pl

from the command line succeeds. Clearly it is the space that is the problem. What to do?
0
Comment
Question by:HilltownHealthCenter
2 Comments
 
LVL 6

Expert Comment

by:RPCIT
ID: 24296765
Try

Dim runCmd As String
runCmd = "c:\perl2.exe W_router.pl"
WshShell.Run runCmd

I've had a little trouble (inconsistently) with VBS and passing commands with parameters.  but wrapping it in a string seems to help.  
0
 
LVL 27

Accepted Solution

by:
bluntTony earned 50 total points
ID: 24296799
Try using:
WshShell.Run "c:\perl2.exe W_router.pl"
I don't think you need the double quotes. The space signifies the start of the argument so it's OK. Encompassing it all in quotes is making the script look for a file call 'c:\perl2.exe W_router.pl', rather than a file called 'C:\perl2.exe' and an argument 'W_router.pl'.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
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…
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…

706 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