insert a variable to cmd command

后端 未结 2 533
孤城傲影
孤城傲影 2020-12-02 03:30

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.         


        
2条回答
  •  [愿得一人]
    2020-12-02 03:41

    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
    

提交回复
热议问题