Batch WMIC redirecting output and wrapping into variable
I'm trying to use WMIC to remove some old printers on our older print servers if I use the below syntax from the command line it works WMIC PRINTER WHERE "SERVERNAME LIKE '%%OLDSERVERNAME%%'" DELETE I was asked to see if I could make it replace the printers or update them to spare the helpdesk from getting "how do I add my printer" calls I tried some variation with SET to set the properties for SERVERNAME, it appear to process, but nothing changes and doing a GET shows the old value still. so I figured I could do a FOR /F loop, wrap the name of the printer (sharename) in a variable and then