|
|
|
| 9 May 2003 | slQueryHotFix() |
| Author | ScriptLogic Corporation |
| Action | Queries whether a specific hotfix is installed -or- returns a string of all the hotfixes that are installed. |
| Syntax | slQueryHotFix ([HotFix]) |
| Parameters | |
| Remarks | This function is only supported on the NT-family of products (NT4/2000/XP/etc.) The hotfix parameter can optionally contain the name of a remote computer in the form of "\\computer\hotfix" You may notice a second optional parameter in the source code. This is for backward compatibility with the previous version of this UDF that was published as QueryHotFix(). |
| Returns | If a specific hotfix name was supplied, a 0 will be returned if the hotfix is not installed, or a 1 will be returned if the hotfix is installed. If no hotfix name was supplied, a string of all installed hotfixes will be returned (each separated by a space). |
| Examples |
; example 1
?'List of all hot fixes installed on this computer:'
$HFarray=split(QueryHotFix()
for each $element in $HFarray
? $element
next
; example 2
?'List of all hot fixes installed on a different computer'
$HFarray=split(QueryHotFix('\\Computer2')
for each $element in $HFarray
? $element
next
; example 3
:loop1
?'Test for a specific hot-fix'
?'Enter computer name (EXIT to terminate):'
gets $cname
if $cname='EXIT'
quit 0
endif
if not $cname
$cname=@WKSTA
endif
?'Enter HotFix name:'
gets $hfname
$result=QueryHotFix('\\'+$cname+'\'+$hfname)
if $result
? $HFname+' is installed on '+$cname
else
? $HFname+' is NOT installed on '+$cname
endif
goto loop1
|
| Source | FUNCTION slQueryHotFix (OPTIONAL $hotfix, OPTIONAL $bcp) ; Last revised: 2002-Jul-25 ; Developed by ScriptLogic Corp. / www.scriptlogic.com ; Parameter: $HotFix (optional) ; If parameter is omitted, a string of all installed hotfixes is returned. ; Alternatively, Parameter can be the name of a specific hotfix to test for: ; If the hotfix is installed, this function returns a numeric 1. ; If the hotfix is not installed, this function returns a numeric 0. ; This function is only supported on the NT-family of products (NT4/2000/XP/etc.) ; Examples for $HotFix parameter: ; \\computer\hotfix ; \\computer ; hotfix ; |
|
|
|