troubleshooting Question

Pass username and password in windows batch

Avatar of jskfan
jskfanFlag for Cyprus asked on
Windows BatchScripting Languages
2 Comments1 Solution135 ViewsLast Modified:
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
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros