Enable "Print Directly to Printer" using Windows Batch

jskfan
jskfan used Ask the Experts™
on
Enable "Print Directly to Printer" using Windows Batch

The Powershell Code below will enable the option : "Print Directly to Printer" on the remote computer (w12)
I would like to have windows batch script that does the same thing instead of Powershell.

Thank you

$printer = Get-WmiObject -Class Win32_Printer -Filter "Name = 'Myprinter'" -ComputerName w12
$printer.Direct= $true
$printer.Put()

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Then use wmic:
wmic.exe /node:w12 printer where "Name='Myprinter'" set Direct=1

Open in new window

Author

Commented:
Excellent oBdA   !!!
It worked

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial