Solved batch to read password from txt file

November 25, 2011 at 08:22:06
Specs: Windows 7
I have username and password in txt file-one string.I have batch that run application that require username and password.I want that batch supply username/password from txt file,in variable form:

sqlplus "username/password" -argument

So i want that instead "username/password" put variable which will read data from txt file:

sqlplus @variable -argument.

I need this because we need to change password every month,and because we need to run more instances of this app (every have it's own batch),i want to change password only once in txt file,not in every batch files

Thanks in advance


See More: batch to read password from txt file

Report •

#1
November 25, 2011 at 09:03:54
✔ Best Answer
I can post the following sample code you may embed jnto your scripts.

First of all create the userid/password file, just one line, according to the format you need e.g if username/password then List.txt will store BobCat/X123YH.

then

set /P ID_PSW=< "List.txt"
sqlplus "%ID_PSW%" -argument

and you are done.


Report •

#2
November 25, 2011 at 09:29:51
Thanks for replay,i googled in meantime and found next:


set /p userpass=<passwordfile.txt

sqlplus "%userpass%" -argument

which is actually same solution,
thanks again

This post can be tagged as solved


Report •
Related Solutions


Ask Question