getting for command to work
Posted: 27 Feb 2015 12:46
need help on the last lines of this script with for command i need it to set %thepasswordtouse% variable to the text in the document. This doc contains only 1 line of txt.
Code: Select all
@echo off
IF EXIST sam2.pas goto :passwordfiledoesexist (
) else (
cls
echo Welcome to Greg's Batch OS
set /p passwordin=Pick a password to log in with:
doskey /reinstall
set /p passwordcheck=Retype the password:
doskey /reinstall
if "%passwordin%" == "%passwordcheck%" (
goto :passwordisgud
) ELSE (
:: test only part
cls
echo Passwords do not match.
pause
goto :passwordredo
:: eot
)
:passwordisgud
echo passwords match.
pause
cls
goto :
)
:passwordfiledoesexist
cls
doskey /reinstall
for /f %%a in ('findstr hextemp.pas') do set thepasswordtouse=%%a
echo %%a
pause