Jump to content

Recommended Posts

Posted

This has probably been asked many a times but can't seem to find an answer.

 

Currently printers are added via script apart from one ICT suite. The Black one is on the print server, the colour one is added via directly to the IP of the printer.

 

Is there a script command to set the black as default?

 

The desktops are XP and we're on Server 2003.

 

Thanks y'all.

Posted

This VBS script will set the default printer. You maybe can use this or include it in your existing script

 

Option Explicit
Dim network
Set Network = CreateObject("Wscript.Network")
Network.SetDefaultPrinter "\\printserver\printershrednamed"

 

If you want to use it with local attached printers:

 

 

Option Explicit
Dim network
Set Network = CreateObject("Wscript.Network")
Network.SetDefaultPrinter "printername"

  • Thanks 2
Posted
Also the way we deploy our printer it takes a few seconds for the printer to show up. so i put a sleep in there to give the printer time to install first.
Posted

We have a pretty good script that runs here using con2prt

 

You set all the printers at the top of the script, they can be anywhere really but all of ours are on a print server. Then you connect the printers at the bottom using either usernames or computernames using /CD to set default and /C to just add one, leaving the default as it is. We used to have an environment variable in there too but that is now obselete.

Here is a shortened version of our script

 

@echo off && CLS
Title Printer Setup Program

FOR /F "tokens=1,* delims=-" %%F IN ("%Computername%") DO set Computer=%%F
FOR /F "tokens=3,* delims=." %%F IN ("%username%") DO set user=%%F
cls
echo Computer Name is %Computer% && echo Room ID is %Room% && echo User Name is %username%  && echo End of UserName is %user%

IF NOT EXIST "%systemroot%\con2prt.exe" Copy "\\shared\Scripts\files\con2prt.exe" "%systemroot%\con2prt.exe"

set PrinterServer=\\printers
set con2prt=%systemroot%\con2prt.exe

Title Printer - Configuring

:: Art
set ArtUpper="%PrinterServer%\ART_Upper_CYM"
set ArtLower="%PrinterServer%\ART_Lower_CYM"
etc....
:: Art
IF "%Username%" == "username of someone"		"%con2prt%" /CD %ArtUpper% /C %ArtLower% /C %ArtLowerA3%

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



×
×
  • Create New...