No announcement yet.

Batch to read password from txt file

  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch to read password from txt file

    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

  • #2
    Re: Batch to read password from txt file

    Something like this?
    @echo off
    Set "c=global.txt"
    set "@var="
    For /f "usebackq tokens=*" %%* in ("%c%") do set @var="%%*"
    If defined @var start sqlplus.exe [email protected]% -argument

    This posting is provided "AS IS" with no warranties, and confers no rights.


    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts