How to Map a printer using logon scripts (visual basic method)
Reciently, i wanted to try and be cool by writing logon script to add a printer to a computer. Thinking oh i'll just use the net use \\devicename command in the logon script and everything will work great. Well no, it doesn't quite work that way. Sure the printer will be added to the system, but it will not show up under the printers control panel in the system and you can only print to in while in a DOS program... In fact, the command is very confusing because you cant even tell if its doing anything unless you go to the command prompt and type 'net view' command. Basically not very helpful at all. So i did a little research, and alas, i have found a better way... Use the VBS scripting method to add the printer.
1) Create a text file called 'map_printers.vbs'
2) paste the following code into the file
'-------------------------------------------
' Windows Logon Script for mapping printers.
Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection "\\computername\printersharename."
'-------------------------------------------
3) now, place a reference to the map_printers.vbs in the users regular logon script. Note, that you may get an error message if your running the script on the users computer who is shairing the printer. The next time the user logs on to the computer, the printer should map automatically.
This works great because it makes your job easier. If you never have to remember to add that printer every time you give your user a new computer it will never be a problem. If you want to get more information, you can look it up on Microsoft Web Site
This little trick works very well when you have alot of users, and/or alot of printers. Happy scripting.

Recent comments
2 years 13 weeks ago
2 years 23 weeks ago
2 years 23 weeks ago
2 years 29 weeks ago
2 years 35 weeks ago
2 years 37 weeks ago
2 years 49 weeks ago
2 years 49 weeks ago
2 years 50 weeks ago
3 years 12 weeks ago