0
We are redesigning the machine park here of the company and the new machines came with Windows 10, unlike the Windows 7 that we used before. The first problem we had was with the way Windows 10 manages printing, through its managed and not through the standard printer. I was able to disable this through a batch file that starts every user who logs into the machine by changing the corresponding record.
reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" /v LegacyDefaultPrinterMode /t "REG_DWORD" /d "1" /f
The problem now is that the Print Manager is disabled, but Windows puts any of the printers as default. I then continued the batch to, in case you have a printer connected via USB, that printer is used as default
wmic printer where portname="USB001" call setdefaultprinter
However, some computers use remote printers, mapped as local ports, through the computer name " Samsungm’s computer name" (Standard name for sharing printers). I then tried to modify the file so that it would select the default printer itself. If there is a printer connected via USB, use it, otherwise use the printer that has as port "%Samsungm", but my code is not working...
set var=wmic printer get portname
%var% > portas.txt
if /I "%samsungm" == "portas.txt" equal (
wmic printer where "PortName like '%samsungm'" call setdefaultprinter
) else (
wmic printer where portname="USB001" call setdefaultprinter
)
The individual commands to set the printer as default work, so I believe it’s something in my If that’s wrong.
I think that part of "Equal" in the if shouldn’t be there either...
– Ricardo Bohner