Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Windows Script Host (WSH) facilitates developing scripts for Windows 7 using scr

ID: 3594812 • Letter: W

Question

Windows Script Host (WSH) facilitates developing scripts for Windows 7 using scripting languages such as Visual Basic

. a. Write down a visual basic script (hw3_yourlastname2.vbs) which will display the current user’s login name, computer name, domain name and user profile (home folder) in a message box (20%)

b. Write down a visual basic script (hw3_yourlastname3.vbs) which will list all the printers (including virtual ones such as Adobe Writer) and their assigned port(s) defined on your machine (20%)

Explanation / Answer

a) visual basic script is as follows:

Set objNet = CreateObject("WScript.NetWork")

Dim stringInfo
stringInfo = "UserDomain " & objNet.UserName & vbCRLF & _
          "PC Name " & objNet.ComputerName & vbCRLF & _
          "DomainName " & objNet.UserDomain
MsgBox stringInfo

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote