我只想尝试创建一个简单的输入脚本,其中“FJobName”是我想在raiseevent字符串“FJobName”中插入的变量。任何想法,我得到了什么工作?
Dim FJobName, objShell
FJobName=InputBox ("JobName","ACT Create Job")
result=Msgbox(FJobName ,vbYesNo)
If result = vbYes Then
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "raiseevent ACTCreateJob_r3 FJobName -host 194.128.255.22 -port 61235"
Else
End if
答案 0 :(得分:0)
您需要将FJobName与命令字符串连接起来。即你的脚本应该是这样的:
Dim FJobName, objShell
FJobName=InputBox("JobName","ACT Create Job")
result=Msgbox(FJobName ,vbYesNo)
If result = vbYes Then
Set objShell = WScript.CreateObject ("WScript.shell")
objShell.run "raiseevent ACTCreateJob_r3 " & FJobName & " -host 194.128.255.22 -port 61235"
End if