Solved

WSH escape character?

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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.
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…
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…

708 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

19 Experts available now in Live!

Get 1:1 Help Now