I have discovered a solution to the issue.
import wmi
c = wmi.WMI()
wql = "SELECT * FROM WIN32_PRINTER WHERE Default = TRUE"
for printer in c.query(wql):
selectedPrinter = printer.caption
where selectPrinter is the device name of the printer.
Hope this helps somebody in the future.
Johnf
On 2/26/20 8:48 AM, Terry Davis wrote:
Hi John,
In the Windows RDP client, under "Show Options" -> "Local Resources"
-> section "Local devices and resources" is "Printers" checked?
I haven't tried what you're referring to, but perhaps that setting is
relevant to your problem?
- Terry
On Tue, Feb 25, 2020 at 5:51 PM john <jo...@jfcomputer.com
<mailto:jo...@jfcomputer.com>> wrote:
Hi,
I need a way to determine the default printer (on the users
computer) from a RDP session.
The user logs on to a RDP session and
win32print.GetDefaultPrinter() returns a blank. That makes sense
on the RDP session because there aren't any default printers. RDP
printing is directed to the default printer on the users desktop.
Is there a way to get the default printer from the RDP session.
Johnf
_______________________________________________
python-win32 mailing list
python-win32@python.org <mailto:python-win32@python.org>
https://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32