|Why does this not work? It doesn't make sense! It's just refusing to do any code:|
if exist "%file%.txt" do (
for /F "delims=" %%j in (%file%.txt) do (
set /A cnt+=1
if %cnt% == 1 (
set /A cnt-=1
) else set line!cnt!=%%j
) else (
if %tested% == 1 (
echo.Error: Couldn't create new data.
if %tested% == 0 (
echo.No data found.
echo.Create new data?
if %errorlevel% == 1 call :name
if %errorlevel% == 2 (
echo.Ok. Program will now close.
echo.What is your name?
set /p name=""
rem Put code in later
The output is usually just the pause then it closes. And no, the data file doesn't exist. And yes, I have tried switching the data file's name (many times).
Also: Thanks ahead of time! I would like help soon (though I can wait)!