' This VBScript program is run using the PC_Tests.cmd Batch Script
Set args = WScript.Arguments
WScript.Echo vbCrLf
Select Case args.Item(0) Case "1" Call System_Information Case"2" Call System_Memory_Size Case "3" Call OS_Version Case "4" Call Printers_Status Case "5" Call Logical_HDD_Information End Select Sub System_Information Set WshShell = WScript.CreateObject("WScript.Shell") WScript.Echo "The computer name is ............ " & _ WshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") WScript.Echo "The Num of CPUs is .............. " & _ …show more content…
" & objItem.Description & vbCrLf & _ "Volume Name .......... " & objItem.VolumeName & vbCrLf & _ "Drive Type ........... " & objItem.DriveType & vbCrLf & _ "Media Type ........... " & objItem.MediaType & vbCrLf & _ "VolumeSerialNumber ... " & objItem.VolumeSerialNumber & vbCrLf & _ "Size ................. " & Int(objItem.Size /1073741824) & " GB" & vbCrLf & _ "Free Space ........... " & Int(objItem.FreeSpace /1073741824) & " GB" Next End Sub Sub Printers_Status strComputer ="." intPrinters = 1 Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery _ ("SELECT * FROM Win32_Printer") WScript.Sleep(1000) For Each objItem In colItems WScript.Echo _ "Printer: " & objItem.DeviceID & vbCrLf & _ "===============================================" & vbCrLf & _ "Driver Name ............. " & objItem.DriverName & vbCrLf & _ "Port Name ............... " & objItem.PortName & vbCrLf & _ "Printer State ........... " & objItem.PrinterState & vbCrLf & _ "Printer Status .......... " & objItem.PrinterStatus & vbCrLf & _ "Print Processor ......... " & objItem.PrintProcessor & vbCrLf & _ "Spool Enabled ........... " & objItem.SpoolEnabled & vbCrLf & _ "Shared .................. " & objItem.Shared & vbCrLf &