I am trying to assign a value to a task sequence variable. I've created the Microsoft.SMS.TSEnvironment object, I've verified it's a valid object, but when I try to assign it a value, I get "Expression continues past expected end. I'm using a Winbatch variables for both my task sequence variable name and value. I thought that might be a problem, so I tried hardcoding the name and value. No joy. Why is this happening to me? Is there a better way to verify that this object is legit?
; Set the program to goto the WBErrorHandler function if there is a problem.
; Resume DebugTrace (if it was already active)
vobjTSE = CreateObject("Microsoft.SMS.TSEnvironment")
vintObjectType = VarType(vobjTSE)
If (vintObjectType & 1536) != 1536 || vintObjectType == 0 Then
vobjTSE(vstrTSVariable) = vstrValue
If StriCmp(vobjTSE(vstrTSVariable),vstrValue) == 0 Then