67% found this document useful (3 votes)
1K views2 pages

VBScript IP Array Report

Devry COMP230 W4 script iparryreport.vbs This is the source code for the Week 4 script If you are having trouble with this lab you can reference this working script.

Uploaded by

Diayeah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
67% found this document useful (3 votes)
1K views2 pages

VBScript IP Array Report

Devry COMP230 W4 script iparryreport.vbs This is the source code for the Week 4 script If you are having trouble with this lab you can reference this working script.

Uploaded by

Diayeah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

' VBScript:

' Written by:


' Date:
' Class: COMP230
' Professor:
' ===================================
' This initialize a 2-dimension array
' of IP Address. The first index +100
' is the room# and the second index+1
' is the computer# in the room.
dim ipAddress(5,3)
ipAddress(0,0)="192.168.10.11"
ipAddress(0,1)="192.168.10.12"
ipAddress(0,2)="192.168.10.13"
ipAddress(0,3)="192.168.10.14"
ipAddress(1,0)="192.168.10.19"
ipAddress(1,1)="192.168.10.20"
ipAddress(1,2)="192.168.10.21"
ipAddress(1,3)="192.168.10.22"
ipAddress(2,0)="192.168.10.27"
ipAddress(2,1)="192.168.10.28"
ipAddress(2,2)="192.168.10.29"
ipAddress(2,3)="192.168.10.30"
ipAddress(3,0)="192.168.10.35"
ipAddress(3,1)="192.168.10.36"
ipAddress(3,2)="192.168.10.37"
ipAddress(3,3)="192.168.10.38"
ipAddress(4,0)="192.168.10.43"
ipAddress(4,1)="192.168.10.44"
ipAddress(4,2)="192.168.10.45"
ipAddress(4,3)="192.168.10.46"
ipAddress(5,0)="192.168.10.51"
ipAddress(5,1)="192.168.10.52"
ipAddress(5,2)="192.168.10.53"
ipAddress(5,3)="192.168.10.54"
' Define program variables
roomStr=""
compStr=""
roomNum=0
compNum=0
ans = ""
Do
WScript.Echo "Please Enter the Room Number (100-105) ...... "
roomStr = WScript.StdIn.ReadLine
If IsNumeric(roomStr) Then
If (roomStr >= 100) And (roomStr <= 105) Then Exit Do
End If
WScript.Echo Chr(7)
WScript.Echo Chr(7)
WScript.Echo "Error, 100 to 105 Only!!!"
Loop
Do
WScript.Echo "Please Enter the Computer Number (1-4) ......"
compStr = Wscript.StdIn.ReadLine
If IsNumeric(compStr) Then
If (compStr >= 1) And (compStr <=4) Then Exit Do
End If

WScript.Echo Chr(7)
WScript.Echo Chr(7)
Wscript.Echo "Error, 1 to 4 Only!!!"
Loop
'Display All IP Address Y/N?
Do
WScript.StdOut.Write ("Do you wish to
..")
ans = WScript.StdIn.Readline()
If ans <> "Y" AND ans <> "y" AND ans <>
WScript.StdOut.Write chr (7)
WScript.StdOut.Write chr (7)
WScript.StdErr.Write "Error,Y,y,N,n
End If
Loop While ans <> "N" AND ans <> "n" AND

Display all of the IP Address (Y/N)....


"N" AND ans <> "n" Then
Response Only!!!"
ans <> "Y" AND ans <> "y"

If ans = "Y" Or ans = "y" Then


For roomNum = 0 to 5
For compNum = 0 to 3
WScript.Echo "The IP Address in Room " & roomNum+100 & " for computer " &
compNum+1 & " is " & ipAddress(roomNum,compNum)
Next
Next
End If
If ans = "N" Or ans = "n" Then
WScript.Echo "The IP Address in Room " & roomStr & " for computer " & co
mpStr & " is " & ipAddress(roomNum,compNum)
End If

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy