Link to home
Start Free TrialLog 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

ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Thank you very much!!