Solved

Visual basic command includes a <space>

Posted on 2009-05-04
2
256 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
[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 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
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…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

617 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