UVK scripting commands - <AutoItScript> |
This mode allows you to embed one or more AutoIt scripts in a UVK script. UVK will run the script with administrator privileges.
@ScriptDir will be the UVK's install folder. AutoIt does not need to be installed to run the script. However, if you want to #include any of the AutoIt's builtin UDFs or Constants, you will need to install it, or copy the functions and Constants to the UVK script.
Example:
<Comment>
This useful script will give information about installed AntiVirus, AntiSpyware and Firewall products.
<AutoItScript>
_CheckAV()
Func
_CheckAV()
Local $oWMI = (@OSVersion =
"WIN_XP") ? _
ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\SecurityCenter")
: _
ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\SecurityCenter2")
If Not IsObj($oWMI) Then
MsgBox(0,"AV check", "Error: Could not get WMI object")
Return 0
EndIf
Local $colItems = $oWMI.ExecQuery("Select * from
AntiVirusProduct")
Local $msgstr =
"Installed AntiVirus software:"&@CRLF, $avstr, $state
If Not IsObj($colItems) Then
$avstr = "Could not query installed Antivirus software!"&@CRLF
Else
For
$objProduct in $colItems
$avstr = $objProduct.DisplayName
$state = $objProduct.ProductState
$avstr &= BitAND($state,0x1000) ? " [Enabled" : " [Disabled"
$avstr &= BitAND($state,0x40000) ? "|Updated]" : "|Outdated]"
$avstr &= @CRLF
Next
$msgstr &=
($avstr = "") ? ("Antivirus software not installed!"&@CRLF) :
$avstr
EndIf
$msgstr &= @CRLF&@CRLF&"Installed AntiSpyware software:"&@CRLF
$colItems = $oWMI.ExecQuery("Select * from AntiSpywareProduct")
If Not IsObj($colItems) Then
$avstr = "Could not query installed AntiSpyware software!"&@CRLF
Else
$avstr = ""
For $objProduct in $colItems
$avstr = $objProduct.DisplayName
$state = $objProduct.ProductState
$avstr &= BitAND($state,0x1000) ? " [Enabled" : " [Disabled"
$avstr &= BitAND($state,0x40000) ? "|Updated]" : "|Outdated]"
$avstr &= @CRLF
Next
$msgstr &=
($avstr = "") ? ("AntiSpyware software not installed!"&@CRLF) :
$avstr
EndIf
$msgstr &= @CRLF&"Installed Firewall software:"&@CRLF
$colItems = $oWMI.ExecQuery("Select * from FirewallProduct")
If Not IsObj($colItems) Then
$avstr = "Could not query installed Firewall software!"&@CRLF
Else
$avstr = ""
For $objProduct in $colItems
$avstr = $objProduct.DisplayName
$state = $objProduct.ProductState
$avstr &= BitAND($state,0x1000) ? " [Enabled]" : " [Disabled]"
$avstr &= @CRLF
Next
$msgstr &=
($avstr = "") ? ("Firewall software not installed!"&@CRLF) :
$avstr
EndIf
MsgBox(64,"AV check", $msgstr)
EndFunc ;==> _CheckAV
Back to the list