Server = "\\lycofs01.lycoming.edu\"
ServerShare = Server & "public"
UserName = UserInput( "Enter your username:" )
Password = UserInput( "Enter your password:" )

dim NetworkObject

'Maps a temporary drive
Set NetworkObject = Nothing
Set NetworkObject = CreateObject("WScript.Network")
NetworkObject.MapNetworkDrive "Z:", ServerShare, False, "lycoming\" & UserName, Password

'Installs the Library Wireless Printer
Set NetworkObject = Nothing
Set NetworkObject = CreateObject("WScript.Network") 
NetworkObject.AddWindowsPrinterConnection Server & "Library_Wireless_4050"

'Removes the networked drive
Set NetworkObject = Nothing
Set NetworkObject = CreateObject("WScript.Network") 
NetworkObject.RemoveNetworkDrive "Z:"

WScript.Echo "The printer was installed successfully"

'Function used to get user input
Function UserInput( myPrompt )
    If UCase( Right( WScript.FullName, 12 ) ) = "\CSCRIPT.EXE" Then
        WScript.StdOut.Write myPrompt & " "
        UserInput = WScript.StdIn.ReadLine
    Else
        UserInput = InputBox( myPrompt )
    End If
End Function
