Solved

WSH escape character?

Posted on 2004-08-18
4
1,466 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
[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 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

624 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