Question
Im just trying to make a simple input script something like this where "FJobName" is the variable I want to insert in raiseevent string "FJobName". Any ideas, what I got aint workin?
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
Solution
You need to concatenate FJobName with the command string. I.e. your script should look like this:
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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow