OPEN "LPTx": problems on Windows
Posted: Mon Dec 01, 2014 12:07 pm
Open LPT1 etc with a work around
Here are two ways to select a printer on a windows OS from the command line. Try it from a SHELL... Both set the printer of your choice as the default. It could be used instead of open "LPTx"
1. RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printer"
Example:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "HP Officejet Pro 8500"
2. wmic printer get name,default
(It shows all the printers)
Default Name
FALSE HP_printer_2ndFloor
TRUE HP_COLOR_PRINTER
change The default printer to 'HP-printer_2ndFloor'.
wmic printer where name='HP-printer_2ndFloor' call setdefaultprinter
3. wmic printer get name
This is more brief and only lists the printers. But is usefull if you forgot the printer names. With 2. and 3. You could save the list by adding > printers.doc viz.-
wmic printer get name,default > MyPrinters.doc
wmic printer get name > MyPrinters.doc
The port/location is already setup in windows when you use "Add Printer" So it will also work on a network. Specific printer control codes can now again be used.
Source:-
http://community.spiceworks.com/how_to/ ... ine-prompt
http://www.windows-commandline.com/set- ... windows-7/
Here are two ways to select a printer on a windows OS from the command line. Try it from a SHELL... Both set the printer of your choice as the default. It could be used instead of open "LPTx"
1. RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printer"
Example:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "HP Officejet Pro 8500"
2. wmic printer get name,default
(It shows all the printers)
Default Name
FALSE HP_printer_2ndFloor
TRUE HP_COLOR_PRINTER
change The default printer to 'HP-printer_2ndFloor'.
wmic printer where name='HP-printer_2ndFloor' call setdefaultprinter
3. wmic printer get name
This is more brief and only lists the printers. But is usefull if you forgot the printer names. With 2. and 3. You could save the list by adding > printers.doc viz.-
wmic printer get name,default > MyPrinters.doc
wmic printer get name > MyPrinters.doc
The port/location is already setup in windows when you use "Add Printer" So it will also work on a network. Specific printer control codes can now again be used.
Source:-
http://community.spiceworks.com/how_to/ ... ine-prompt
http://www.windows-commandline.com/set- ... windows-7/