Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for bios.kix

(view source code of bios.kix as plain text)

  1. ; Check KiXtart version
  2. $KixMajorVer = SubStr( @Kix, 1, InStr( @Kix, "." ) - 1 )
  3. If $KixMajorVer < 4
  4. 	GoTo Syntax
  5. EndIf
  6.  
  7. ; Check command line parameters
  8. Select
  9. 	Case $PC = ""
  10. 		; Default if none specified is local computer (".")
  11. 		$strComputer = @WKSTA
  12. 	Case 1
  13. 		; Command line parameter $PC can either be a
  14. 		; computer name or "/?" to request online help
  15. 		$strComputer = $PC
  16. 		If InStr( $strComputer, "?" ) > 0
  17. 			GoTo Syntax
  18. 		EndIf
  19. EndSelect
  20.  
  21. ; Connect to computer's WMI service
  22. $objWMIService = GetObject( "winmgmts://" + $strComputer + "/root/cimv2" )
  23. ; Display error number if applicable
  24. If @ERROR
  25. 	GoTo ShowError
  26. EndIf
  27.  
  28. ; Collect BIOS information
  29. $colItems = $objWMIService.ExecQuery( "Select * from Win32_BIOS where PrimaryBIOS = true", , 48 )
  30. ; Display error number if applicable
  31. If @ERROR
  32. 	GoTo ShowError
  33. EndIf
  34.  
  35. ; Header line for screen output
  36. ? "BIOS summary for " + $strComputer + ":"
  37.  
  38. ; Prepare collected info for display
  39. For Each $objItem in $colItems
  40. 	? "    BIOS Name       :  " + $objItem.Name
  41. 	? "    Version         :  " + $objItem.Version
  42. 	? "    Manufacturer    :  " + $objItem.Manufacturer
  43. 	? "    SMBIOS Version  :  " + $objItem.SMBIOSBIOSVersion
  44. 	?
  45. Next
  46.  
  47. ; Done
  48. Quit 0
  49.  
  50.  
  51. :ShowError
  52. ? "Error # @ERROR"
  53. ?
  54.  
  55.  
  56. :Syntax
  57. ? "BIOS.kix,  Version 1.10"
  58. ? "Display BIOS information for any WMI enabled computer on the network."
  59. ?
  60. ? "Usage:  KIX32  BIOS.KIX  [ $PC=computer_name ]"
  61. ?
  62. ? "Where:  " + Chr(34) + "computer_name" + Chr(34) + " is the name or IP address of any WMI enabled"
  63. ? "        computer on the network"
  64. ?
  65. ? "Written by Rob van der Woude"
  66. ? "http://www.robvanderwoude.com"
  67. ?
  68. ? "This script requires KiXtart 4.00 or later."
  69. ? "Your KiXtart version is @Kix"
  70. ?
  71. ; Abort with return code 1
  72. Quit 1
  73.  

page last modified: 2024-02-26; loaded in 0.0209 seconds