Solved

WSH escape character?

Posted on 2004-08-18
4
1,464 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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 designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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.
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 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…

685 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