- ...
- If RunningInTaskSequence = True Then
- ...
- Function RunningInTaskSequence()
- On Error Resume Next
- Err.Clear
- Dim objTSEnv : Set objTSEnv = CreateObject("Microsoft.SMS.TSEnvironment")
- If Err Then
- 'Script does not run within the Task Sequence environment
- RunningInTaskSequence = False
- Else
- 'Script does run within the Task Sequence environment
- RunningInTaskSequence = True
- End If
- On Error GoTo 0
- End Function
2/01/2011
vbScript - Get running environment
The following vbScript Function delivers the value true if the script runs within a task sequence environment. If not the functions delivers the value false. This function can be useful in scripts like wrapper and so on.
Labels:
2007,
ConfigMgr,
environment,
false,
microsoft,
running,
SCCM,
sms,
task sequence,
true,
TSEnvironment,
vbscript
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment