Batch to read password from txt file

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

dampyr

Thread Starter
Joined
Nov 25, 2011
Messages
23
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
 

dampyr

Thread Starter
Joined
Nov 25, 2011
Messages
23
Thanks for quick replay:
so complete code will be:



set /p userpass=<passwordfile.txt
sqlplus userpass -argument
right?
 

Squashman

Retired Trusted Advisor
Joined
Apr 4, 2003
Messages
19,786
I know nothing about SQL.
If your username and password are on one line in a text file, the code above will put that into a variable with a batch file.
Code:
C:\Users\Squash>type passwordfile.txt
myuser/mypass

C:\Users\Squash>set /p userpass=<passwordfile.txt

C:\Users\Squash>echo %userpass%
myuser/mypass

C:\Users\Squash>
 

dampyr

Thread Starter
Joined
Nov 25, 2011
Messages
23
Thanks again,yes my username and password are in format username/password,that is whole content of txt file,in single line
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top