Solved

Error on vb script

Posted on 2014-09-09
2
208 Views
Last Modified: 2014-09-10
Hi

when i run this script i got error - Microsoft VBScript compilation error: Expected end of statement

i want to know how to fix this error


Set objShell = WScript.CreateObject ("WScript.Shell")

strservice = C:\Program Files\Tivoli\TSM\baclient\dsmcutil" inst scheduler /name:"TSM Client Scheduler" /node:%computername% /clientdir:"c:\Program Files\Tivoli\TSM\baclient" /optfile:"c:\program files\tivoli\tsm\baclient\dsm.opt" /password:%computername% /validate:yes /autostart:yes /startnow:yes

objShell.Run strservice
0
Comment
Question by:David Regev
[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 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40313052
Missing an opening "

strservice = C:\Program Files\Tivoli\TSM\baclient\dsmcutil"
0
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 40313080
There are a few more double quotes missing, and VBScript can't expand environment variables directly:
Set objShell = WScript.CreateObject ("WScript.Shell")
strComputerName = objShell.ExpandEnvironmentStrings("%ComputerName%")
strService = Chr(34) & "C:\Program Files\Tivoli\TSM\baclient\dsmcutil" & Chr(34) & " inst scheduler /name:" & Chr(34) & "TSM Client Scheduler" & Chr(34) & " /node:" & strComputerName & " /clientdir:" & Chr(34) & "C:\Program Files\Tivoli\TSM\baclient" & Chr(34) & " /optfile:" & Chr(34) & "C:\Program Files\tivoli\tsm\baclient\dsm.opt" & Chr(34) & " /password:" & strComputerName & " /validate:yes /autostart:yes /startnow:yes"
objShell.Run strService

Open in new window

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

737 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