Академический Документы
Профессиональный Документы
Культура Документы
Class
COMP230
Date
COMP230_W2_IPO_VBReport.docx
Capture the NameAge.vbs Run from the console window and copy it into the space provided below:
cscript NameAge.vbs Process started >>> Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Pleast Enter your Full Name.............. Your Name Please Enter your age ................... 28 Your Name is Your Age is Your Name 28
Your Age in 10 years is ...... 38 End of Program <<< Process finished. ================ READY ================
COMP230_W2_IPO_VBReport.docx
Copy your PopUpWindow.vbs program from NotePad++ and paste it into the space provided below:
' VBScript: PopUpWindow.vbs ' Written by: ' Date: ' Class: COMP230 ' Professor: name = "John Doe" ageStr = "50" ageStr10 = CStr( CInt(ageStr)+10 ) WScript.Echo WScript.Echo WScript.Echo ageStr10 & WScript.Echo "Your Name is " & vbTab & vbTab & name "Your Age is " & vbTab & vbTab & ageStr vbCrLf & "Your Age in 10 years is ...... " & _ vbCrLf "End of Program"
name = "John Doe" ageStr = "50" ageStr10 = CStr( CInt(ageStr)+10 ) msgStr = "Your Name is " & vbTab & vbTab & name & _ vbCrLf & "Your Age is " & vbTab & vbTab & ageStr & _ vbCrLf & vbCrLf & "Your Age in 10 years will be ...... " & _ ageStr10 & vbCrLf & vbCrLf & "End of Program" WScript.Echo msgStr
COMP230_W2_IPO_VBReport.docx
Capture the PopUpWindow.vbs Run (using <Alt><PrtSc> to capture the PopUp Window on the desktop) and copy it into the space provided below:
COMP230_W2_IPO_VBReport.docx
Copy your CmdArgs.vbs program from NotePad++ and paste it into the space provided below:
' ' ' ' ' VBScript: CmdArgs.vbs Written by: Date: Class: COMP230 Professor:
Set args = WScript.Arguments If args.Count < 2 then WScript.Echo "You must enter the name and age as Command Line Arguments!!" WScript.Sleep(5000) WScript.Quit end If name = args.item(0) ageStr = args.item(1) ageStr10 = CStr( CInt(ageStr)+10 ) msgStr = "Your name is " & vbTab & vbTab & name & _ vbCrLf & "Your age is " & vbTab & vbTab & ageStr & _ vbCrLf & vbCrLf & "Your Age in 10 years will be ...... " & _ ageStr10 & vbCrLf & vbCrLf & "End of Program" WScript.Echo msgStr
COMP230_W2_IPO_VBReport.docx
Capture the two CmdArgs.vbs console Runs (one without arguments and one using your name and age as arguments) and copy the runs into the space provided below:
C:\Scripts>cscript CmdArgs.vbs Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. You must enter the name and age as Command Line Arguments!!
C:\Scripts>cscript CmdArgs.vbs "Your Name" 28 Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Your name is Your age is Your Name 28
COMP230_W2_IPO_VBReport.docx