Solved

WSH escape character?

Posted on 2004-08-18
4
1,463 Views
Last Modified: 2011-10-03
Hi,

 I am trying to execute an exe using VB script. I am not sure which escape character I have to use.

The script is as follows.
/************/
Dim RetVal
 Set Shell = CreateObject("WScript.Shell")
RetVal = Shell.Run(test -s Major -c "Error Events" "" 10 20 "test message",1)
/************/
test is the exe name and rest are parameters.

Thanks
0
Comment
Question by:ink777
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
aParser earned 50 total points
ID: 11977329
I think the answer is that you want quote-doubling:

/************/
Dim RetVal
 Set Shell = CreateObject("WScript.Shell")
RetVal = Shell.Run("test -s Major -c ""Error Events"" 10 20 ""test message""",1)
/************/

will pass the following command-line

test -s Major -c "Error Events" 10 20 "test message"
0
 
LVL 3

Expert Comment

by:aParser
ID: 12380095
I think I gave a correct answer.
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

Suggested Solutions

Title # Comments Views Activity
Pull multiple cvs files into one access table 28 69
Error when passing an argument to a vb6 that contains  '/' 7 40
Add and format columns in vb6 7 63
Problem to With line 4 63
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

828 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