Batch for loop cannot set variables -
To work through each row in the file named estrat name. Then I grab the line and divide it on semicolon and print the text before semicolon and after semicolon.
My file looks something like this ...
Username: Password username2: password2 username3:
My current code This is:
setlocal ENABLEDELAYEDEXPANSION file = alts.txt for / f "tokens = *" %% (% file%) in% (set str = %% set user " Name =% str :: = "^ and REM #% set" pass =% str: *: =% "Echo username =% username% pass =% pass%) stop
If someone will be sufficient enough to show me my error and in fact the error Will appreciate it a lot to fix.
@echo off setlocal ENABLEDELAYEDEXPANSION set for file = alts.txt / f "tokens = 1,2 delims = "%%" (% file%) in (set "$ user = %% A" set "$ pass = %% B" echo username =! $ User! Pass =! $ Pass!) Stop
% Username% Be careful using
. This is the system variable you can test by typing echo% username%
in CMD prompt. It is better to choose another name for the variable you did as I did.
Comments
Post a Comment