Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×

VBS Scriping for adding new printer


jowen
 Share

Recommended Posts

I have inherited a generic login script for our users on site and I want to migrate their printers onto a new print server. In testing this I have added an existing q from the functional and current print server to the new print server and manually added the printer from the new print server all works fine. However I now want to push out the print mappings through the login script and it will not see my new printer or map to it. I have also created a manual VBS file to map to the new print server q and again it states printer not found. I think my syntax is correct but any help would be appreciated my script shows this;

'

' Printers.vbs - Windows Logon Script.

Set objNetwork = CreateObject("WScript.Network")

objNetwork.AddWindowsPrinterConnection "\\pilgrims-two\colorICT."

My printer is shared out as ColorICT and the server is pilgrims-two, any ideas??

Many thanks

Jo

Link to comment
Share on other sites


'

' Printers.vbs - Windows Logon Script.

Set objNetwork = CreateObject("WScript.Network")

objNetwork.AddWindowsPrinterConnection "\\pilgrims-two\colorICT."

My printer is shared out as ColorICT and the server is pilgrims-two, any ideas??

Many thanks

Jo

Try putting the path to the printer in a variable, then using that variable in the "AddWindowsPrinterConnection" method, as is shown at:

http://msdn.microsoft.com/en-us/library/zsdh7hkb%28VS.85%29.aspx

Link to comment
Share on other sites

If the code posted if your actual code, remove the period after the printer name.

objNetwork.AddWindowsPrinterConnection "\\pilgrims-two\colorICT."

to

objNetwork.AddWindowsPrinterConnection "\\pilgrims-two\colorICT"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...