Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Local Printer Through Script

Status
Not open for further replies.

marc91215

IS-IT--Management
Sep 24, 2004
36
US
Hello -

I am in a school district and teachers keep changing their default printer from the local to the network and the script i have adds the network printer but does not grab default so it could be kept on the local. After the teacher changes it to the network there is nothing in the script to change it back. Does anyone know of a way to specify local default printer in a vbs?

Thanks
marc
 
Set printer as default:
REM Make the PrintUI entry twice. '/y' sets the default printer

rundll32 printui.dll,PrintUIEntry /u /n "printer"
rundll32 printui.dll,PrintUIEntry /y /n "printer"

Replace "printer" with the defined printer name of the printer you wish to make the local default printer.

See also:
thread779-581142
thread779-923331
 
Does "Prnmngr.vbs" typed in the Help and Support program provide a possible solution?
 
Linney,

Yes it can be used:

cscript prnmngr.vbs -t -p PrinterName

Parameters
-t
Required. Specifies that you want to set the default printer.
-p PrinterName
Required. Specifies, by name, the printer that you want to set as the default printer.
/?
Displays help at the command prompt.

Remarks
This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.
If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top