Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary COMP 230 WEEK 5 LAB VBSCRIPT MODULAR LAB REPORT

Rating
-
Sold
-
Pages
8
Uploaded on
11-03-2022
Written in
2021/2022

COMP 230 WEEK 5 LAB VBSCRIPT MODULAR LAB REPORT

Institution
Course

Content preview

Name
August 09, 2014
Professor
COMP-230-61430
COMP 230 WEEK 5 LAB VBSCRIPT MODULAR LAB
REPORT
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




COMP230_Wk5_Modular_Report.docx 1 Revision Date: 1213

, Name
August 09, 2014
Professor
COMP-230-61430
Continuation of the Mod1_PCTests.vbs program from NotePad++.
Sub OS_Version
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
WScript.Echo "The Operating System Detected is Shown Below:" & vbCrLf
For Each objOperatingSystem in colOperatingSystems
WScript.Echo objOperatingSystem.Caption & "Version: " & _
objOperatingSystem.Version
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 & _
"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 & _
"========================================" & vbCrLf & _
"Drive Letter ......... " & objItem.Name & vbCrLf & _
"Description .......... " & 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




COMP230_Wk5_Modular_Report.docx 2 Revision Date: 1213

Written for

Institution
Course

Document information

Uploaded on
March 11, 2022
Number of pages
8
Written in
2021/2022
Type
SUMMARY

Subjects

$10.50
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
SmartMind Chamberlain College Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
110
Member since
4 year
Number of followers
112
Documents
1682
Last sold
1 year ago

3.5

22 reviews

5
8
4
6
3
2
2
2
1
4

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions