Link to home
Create AccountLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

Pass username and password in windows batch

Pass username and password in windows batch

I have this code that enables direct print on the printers of each computer read from csv file CompOnly.csv
each computer is accessed with the same username and password. I just want the code below to pass username and password , so that I do not get access denied or popu to enter user name and password for each computer.

Thank you

FOR /f "delims=" %%G in (c:\Scripts\CompOnly.csv) DO wmic.exe /node:%%G printer where "Name='Myprinter'" set Direct=1

Timeout 5

Open in new window

Avatar of oBdA

Link to home
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of jskfan


Thank you very much!!