COMP 230 WEEK 5 ILAB
VBSCRIPTMODULAR LAB
REPORT(1) NEW UPDATED2021
, Name:
Date: August 09, 2014
Professor:
VBScript Modular Lab Report
Copy your Mod1_PCTests.vbs program from NotePad++ and paste it into the space provided below.
Any portion of the script that will not fit should be continued in the textbox on the next page.
' VBScript: MOD1_PC_Tests.vbs
' Written By:
' Date: 08/09/2014
' Class:Comp230
' Professor:
' ===================================
' Menu Driven Computer / Network Tests
' This VBScript program is run using the MOD1_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
case Else
WScript.Echo chr(7) & chr(7) & "Error, Choices are 1..5 or x!!!"
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 .............. " & _
WshShell.ExpandEnvironmentStrings("%NUMBER_OF_PROCESSORS%")
WScript.Echo "The Processor Architecture is ... " & _
WshShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%")
End Sub
Sub System_Memory_Size
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colComputer = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
intRamMB = int((objComputer.TotalPhysicalMemory) /1048576)+1
Wscript.Echo "System Name ...... " & objComputer.Name _
& vbCrLf & "Total RAM ........ " & intRamMB & " MBytes."
Next
End Sub
Continuation of the Mod1_PCTests.vbs program from NotePad++.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Examhub. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $9.36. You're not tied to anything after your purchase.