Category Archives: Scripting

http://www.amset.info/loginscripts/printers.asp

net use * \\monolith\pc_dist
Maps the directory to the next available drive letter using current login credentials.

net use * \\monolith\pc_dist /user:SCS\bovik
Maps the directory to the next available drive letter using the credentials for the SCS domain user “bovik”. The user will will be prompted for bovik’s SCS domain password.

net use w: \\monolith\pc_dist boviks_password /user:SCS\bovik
Maps the directory to drive W: using the credentials for the SCS domain user “bovik”. The password “boviks_password” will be used to authenticate (and will be displayed in cleartext on the command line).

net use w: \\monolith.scs.ad.cs.cmu.edu\pc_dist boviks_password /USER:scs.ad.cs.cmu.edu\bovik
Does the same thing as the previous command, but may work in situations where the previous command will not (for example, if “monolith” cannot be resolved by your local host).

net use w: \\monolith\pc_dist /persistent:y
Maps the directory to drive letter W: using current credentials and makes the connection persistent. The user will prompted to re-enter the password at next logon. Use the savecred switch on Windows XP to reconnect.

net use w: /delete
Deletes the mapped network drive, W:.

net use

Lists the network drives that you have mapped

http://www.cs.cmu.edu/~help/windows/mapping_drives.html

The following VBScript code will connect a printer device without trying to use the LPT ports.

The printer device will be available from the printer dialog as a selectable device in any of the print dialogs in windows applications:

Set objWSHNetwork = CreateObject(“WScript.Network”) ‘create network objectstrConnectString = “\\server\printer”strResult = objWSHNetwork.AddWindowsPrinterConnection(strConnectString)

Save it as a .VBS file and change the variable strConnectString to reflect your printer path

Set objNet = WScript.CreateObject(“WScript.Network”)objNet.MapNetworkDrive DriveLetter, “\\SERVER\SHARE“, TRUE