1.

Solve : How to supply password in batch file?

Answer»

Hello,
I am using the 'runas' COMMAND in a BATCH file.
While there are no passwords setup in Windows XP this line works:-
runas args where yes.txt is a file with just one carriage return.

If I create a password, which normally works and add this password to the yes.txt file as just text, the 'runas' command does not accept it.
Why would this be?
Thanking you
FrankDo you have any CODE that you can show us, even though it might not work?The line that FAILS is this:
runas /u:"%*" %_Prog_% Without the yes.txt file runas provides a prompt in the dos window and works.

This is part of the MakeMeAdmin batch file - http://blogs.msdn.com/aaron_margosis/archive/2004/07/24/193721.aspx

Thanks
FrankFound the problem.
The password I keyed into the yes.txt file didn't have the final carriage return.
Once I entered it, it worked.
Thank you very much for making me LOOK at it in more detail.
Frank
Congrats with solving your problem.

Anything else that comes up in the future, let us know and we'll see if we can do anything



Discussion

No Comment Found