Solved

VBScript run an executable

Posted on 2011-09-27
4
275 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

11 Experts available now in Live!

Get 1:1 Help Now