UVK scripting commands - <VBScript> |
This mode allows you to embed one or several Visual basic scripts in a UVK script. UVK will run the script with administrator privileges.
Example:
<Comment>
This useful script will give information about installed AntiVirus, AntiSpyware and Firewall products.
<VBScript>
On Error Resume Next
Dim oWMI,
msgstr, enabled, updated, obj, state
Set oWMI =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\SecurityCenter2")
For Each obj in oWMI.ExecQuery("Select * from AntiVirusProduct")
state = obj.productState
If state And 4096
Then enabled = " [Enabled" Else enabled = " [Disabled"
If state And 262144 Then updated = "|Updated] " Else updated =
"|Outdated] "
msgstr = msgstr &
"AntiVirus: " _
& obj.displayName _
& Enabled _
& Updated _
& vbCrLf
Next
For Each obj in
oWMI.ExecQuery("Select * from AntiSpywareProduct")
state = obj.productState
If state And 4096
Then enabled = " [Enabled" Else enabled = " [Disabled"
If state And 262144 Then updated = "|Updated] " Else updated =
"|Outdated] "
msgstr = msgstr &
"AntiSpyware: " _
& obj.displayName _
& Enabled _
& Updated _
& vbCrLf
Next
For Each obj in
oWMI.ExecQuery("Select * from FirewallProduct")
state = obj.productState
If state And 4096
Then enabled = " [Enabled] " Else enabled = " [Disabled] "
msgstr = msgstr & "Firewall: " _
&
obj.displayName _
& Enabled _
& vbCrLf
Next
MsgBox msgstr, vbInformation
Back to the list