Naguib Ihab
Naguib Ihab

Reputation: 4496

Reading one single line using batch file

I have a currentenv.txt file that contains a single line: admin

I need to read that from a batch file, now I now that I can do that in a loop, i.e.:

for /f %%i in (currentenv.txt) but that seems like an overkill to read one line (it'll always be one single line

Is there an easier/cleaner way to do that?

Upvotes: 0

Views: 79

Answers (1)

Naguib Ihab
Naguib Ihab

Reputation: 4496

Found it: set /p _from_env=<config/currentenv.txt

Upvotes: 1

Related Questions