Change printer properties from command line

test_test test_test 1 Reputation point
2021-10-29T05:12:48.04+00:00

Hello. I create local printer by commands:

PowerShell -Command Add-PrinterPort -Name "D:\MyTestPrinter.txt"  
rundll32 printui.dll,PrintUIEntry /if /b "MyTestPrinter" /r "D:\MyTestPrinter.txt" /m "Generic / Text Only"  

it's ok. But it's need to change page code for new printer (printer properties - font selection - code page) by command line or change register.
Please, help, how I can do it? Thanks!

144871-%D1%81%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA.png

Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
640 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,358 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,341 Reputation points
    2021-10-29T15:37:47.663+00:00

    Hello @test_test test_test ,

    Thank you for your question and reaching out.

    I believe there is no direct Windows PowerShell or cmd for this type of configuration in Printer. you can handle it by using Printer API using ESC/POS command , However its all depends Printer manufacturer

    Below is Microsoft reference example for Epson ESC/POS.
    https://learn.microsoft.com/en-us/windows/uwp/devices-sensors/epson-esc-pos-with-formatting

    -------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments