Here is some code to get the information you're looking for with console output
You can also look here for some more information or ideas
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=2&t=004424






IF @INWIN = 1
SELECT
CASE @ProductType='Windows 2000 Professional'
IF @CSD <> 'Service Pack 4'
? 'Your SP is: '+@CSD+' We will now run an update'
; run update code here
ENDIF
IF @CSD = 'Service Pack 4'
? 'Your system is running the latest Service Pack: '+@CSD
? 'No update required'
ENDIF
CASE 1
? 'Your system does not appear to be a Windows 2000 Workstation'
? 'We show it as: '+@ProductType+' - '+@CSD
QUIT @ERROR
ENDSELECT
ENDIF