cmd中语句的预期结束

时间:2014-03-17 11:46:28

标签: vbscript

为什么我一直收到预期的结束声明

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

oShell.run "cmd.exe /C  "c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd" co -p "bla:bla@bla:1234/bla/" -is -eol on  -o  -rp "D:\ST_test" -cfgl  "12.45.6"

3 个答案:

答案 0 :(得分:3)

因为"必须通过""在VBScript和结束时是假的:

>> s = "cmd.exe /C  "c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd" co -p "bla:b
la@bla:1234/bla/" -is -eol on  -o  -rp "D:\ST_test" -cfgl  "12.45.6")
>>
Error Number:       1025
Error Description:  Expected end of statement
>> s = "cmd.exe /C  ""c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd"" co -p ""bl
a:bla@bla:1234/bla/"" -is -eol on  -o  -rp ""D:\ST_test"" -cfgl  ""12.45.6"""
>> WScript.Echo s
>>
cmd.exe /C  "c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd" co -p "bla:bla@bla:1
234/bla/" -is -eol on  -o  -rp "D:\ST_test" -cfgl  "12.45.6"
>>

答案 1 :(得分:1)

如果是这种情况,那么您的命令最有可能被激活失败。

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

oShell.run "cmd.exe /C ""c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd.exe"" co -p ""bla:bla@bla:1234/bla/"" -is -eol on -o -rp ""D:\ST_test"" -cfgl  ""12.45.6"""

你是否在" D:\ ST_test"之前检查了你的-rp命令,因为从2009年的文档[这里]它说明只使用了rw或ro。

无论如何,我不知道starteam,这不是答案。但由于其背后的参数,该声明似乎失败了。

要正确测试它,请进入命令提示符并复制并通过它:

cmd.exe /C  "c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd" co -p "bl
a:bla@bla:1234/bla/" -is -eol on  -o  -rp "D:\ST_test" -cfgl  "12.45.6"

看看它是如何运作的,或者它是否告诉你要修复的错误。

答案 2 :(得分:1)

找到解决方案:

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

oShell.run "cmd /K ""c:\Program Files (x86)\Borland\StarTeam Cross-Platform Client 2008 R2\stcmd.exe"" co -p 123:123@123.com:7777/123/ -is -eol on -o -rp D:\ST_test -cfgl  3.1.006"

谢谢大家!