get or set default printer

Discuss RoboTask here
Post Reply
photoevents
Posts: 44
Joined: Mon Jan 01, 2024 11:21 am
Contact:

get or set default printer

Post by photoevents »

Next question:
How can I GET or SET the default printer?
or SELECT printer and save to a variable to use in subsequent printing ?

I want to be able to print certain images to printer1, others to printer2, and so on.

Thank you,
Christian
Oleg
Site Admin
Posts: 3084
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: get or set default printer

Post by Oleg »

Take a look on Print Document action
Oleg Yershov
photoevents
Posts: 44
Joined: Mon Jan 01, 2024 11:21 am
Contact:

Re: get or set default printer

Post by photoevents »

I can't use print document action to get and save a printer to a variable.
An action 'Browse for printers' would be a nice add-on.
Mind you, as I work more with robotask I seem to find alternative ways of doing things.
So, this is not a must or urgent but just easier.

Christian
felipe
Posts: 15
Joined: Thu Nov 30, 2023 6:18 pm

Re: get or set default printer

Post by felipe »

execute powershell to get all printers
Get-Printer | Format-List



and this to get active printer
Get-WmiObject -Query "SELECT * FROM Win32_Printer WHERE Default = TRUE"
photoevents
Posts: 44
Joined: Mon Jan 01, 2024 11:21 am
Contact:

Re: get or set default printer

Post by photoevents »

Thank you Felipe.
Post Reply