Hi,
I am trying to create a batch file which will read a text file, and delete last four characters from the text in it…ie
file will read test.txt for mynameis.txt
batch file will change it to
mynameis and store it as a variable
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
set /?
setlocal /?
that you you’ll know what’s going on here.
here’s the quickie version:
@echo off & setlocal enabledelayedexpansion
for /f “tokens=*” %%a in (file.txt) do (
set xx=%%a
set xx=!xx:~0,-4!
echo.!xx!
)