I need to get a input from the user (string) and insert it in a cmd command,
Set oShell = WScript.CreateObject(\"WScript.Shell\")
Set LabelName = WScript.
Build your command in a more structured way - e.g:
Option Explicit
Function qq(s) : qq = """" & s & """" : End Function
Dim sLabel : sLabel = "default label"
Dim oWAU : Set oWAU = WScript.Arguments.Unnamed
If 1 <= oWAU.Count Then sLabel = oWAU(0)
Dim sCmd : sCmd = Join(Array( _
"%comspec%" _
, "/K" _
, qq("c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd.exe") _
, "co" _
, "-p bla:bla123@123.com:7777/bla/" _
, "-is -eol on -o -rp" _
, qq(sLabel) _
))
WScript.Echo sCmd
and display the extra variable sCmd. Fixing (possible) blunders -
ient 2008 R2\stcm
---------^^^
'on second thought' additions -
, qq(sLabel) _
==>
, qq("D:\ST_test") _
, "-cfgl" _
, sLabel _
and the quoting will be much easier.
LabelName doesn't need to be a shell object, as it's just a string. Then concatenate the string onto the run command and you are done.
Set oShell = WScript.CreateObject("WScript.Shell")
Dim LabelName
LabelName = InputBox("Please Enter Label to check-out:", _
"Create File")
oShell.run "cmd /K ""c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd.exe"" co -p bla:bla123@123.com:7777/bla/ -is -eol on -o -rp D:\ST_test -cfgl " & LabelName