Comp230 Week 5 Essay

1806 Words Feb 7th, 2013 8 Pages
Student Name | Class | COMP230 | Date | | VBScript Modular Lab Report ' Menu Driven Computer / Network Tests
' 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.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 & _ "ShareName ............... " & objItem.ShareName & vbCrLf & _ "Horizontal Res .......... " & objItem.HorizontalResolution & vbCrLf & _ "Vertical Res ............ " & objItem.VerticalResolution & vbCrLf intPrinters = intPrinters + 1 Next End Sub Sub Logical_HDD_Information strComputer = "." Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * from Win32_LogicalDisk Where FreeSpace > 0") For Each objItem in colItems WScript.Echo vbCrLf & _

More about Comp230 Week 5 Essay

Open Document