Solved

VBScript run an executable

Posted on 2011-09-27
4
284 Views
Last Modified: 2012-05-12
I get the following error message when trying the below code:
Microsoft VBScript compilation error:  Expected ')'

My quoting off?

dim objShell, boolCode
set objShell = CreateObject("WScript.Shell")
boolCode = objShell.Run("C:\Program Files\A\Load.exe" /project:Alt /s "Tween" /r /w /e)

Open in new window

0
Comment
Question by:kkbenj
  • 3
4 Comments
 
LVL 9

Accepted Solution

by:
jsdray earned 500 total points
ID: 36712747
will it work for you like this:


dim objShell, boolCode
set objShell = CreateObject("WScript.Shell")
boolCode = objShell.Run ("C:\Program Files\A\Load.exe /project:Alt /s Tween /r /w /e")
0
 

Author Closing Comment

by:kkbenj
ID: 36712821
Yes, that did it.
0
 

Author Comment

by:kkbenj
ID: 36712834
WAIT - it is not working:
The system cannot find the file specified.
error message
0
 

Author Comment

by:kkbenj
ID: 36713117
Did the following to get the quoting correct.

dim scriptsetName
scriptsetName = GetXMLText("Defaults\ScriptName")
iLoaderProcess = """" & objFSO.BuildPath(RegRead6432("HKLM\Software\Alt\Path") , "\ETL\iLoaderClient\Load.exe") & """ " & _
"/r         " & _
"/s:""" & scriptsetName & _
"/Project:" & altProjectNm & " " & _
"/Server:localhost"
                                msgbox iLoaderProcess
                boolCode = WScript.CreateObject("WScript.Shell").run ( iLoaderProcess , 1 , true)

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

862 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

24 Experts available now in Live!

Get 1:1 Help Now