I have a script below:
Dim g_oWShell
Set g_oWShell = CreateObject("WScript.Shell")
But when I validate the value of g_oWShell
first, that object is null (nothing). Below are the codes I'm debugging:
If g_oWShell Is Nothing Then
'display an error.
Else
'run Something... (Ex. g_oWShell.Run("...")
End If
I'm new to VBS and I'm not sure why is that the case. I have read a short definition of CreateObject
method here: VBA CreateObject
Advance thanks for explaining what might I have missed.
EDIT:
I'm creating an MSI installer using Visual Studio.