I have tested your script. it works properly but when I put it on windows scheduler (runs every 5 minutes) it become error because when the script didn't find any .txt file to be cut 190 chars, it will create .txt. Could you please check to change the script to not create a .txt file if the script didnt find any file to be cut.
Below is script i modified from you script. I add several rows to change the file to outfile+date+time+.txt.
Please your help to review the script.
Many thanks for your help
@echo off & setLocal enableDELAYedeXpansioN
for /f "tokens=* delims= " %%a in (PF.txt) do (
set /a N+=1
if !N! lss 3 set S=!S!%%a
> 1.txt echo.!S:~190!
for /f "tokens=* skip=2 delims= " %%a in (PF.txt) do (
) >> outfile.txt
for /f "tokens=* skip=2 delims= " %%a in (outfile.txt) do (
if >10 equ %%~zF echo del "%%a"
ren outfile.txt outfile%myvar1%%myvar3%%myvar2%%myvar4%%myvar5%%myvar6%.txt