I use a batch file to create another batch file with some part extracted from a file, it create a long file.
I need to add only one an exit
command in the end of file.
Actually the batch files created do not close after finish the work.
Code File to create another batch file:
:: 'Create Batch File'
@echo off
(for /f "usebackq delims=" %%a in ("D:\Programmi Installati\list.csv") > do (
echo PING -n %%~NXa localhost ^>NUL 2^>^&1
echo/
echo/
)) > "D:\Programmi Installati\new.bat"
Actual result of new.bat (wrong):
PING -n 10 localhost >NUL 2>&1
exit
PING -n 15 localhost >NUL 2>&1
exit
PING -n 20 localhost >NUL 2>&1
exit
PING -n 25 localhost >NUL 2>&1
exit
Aspected result of new.bat
(desired):
PING -n 10 localhost >NUL 2>&1
PING -n 15 localhost >NUL 2>&1
PING -n 20 localhost >NUL 2>&1
PING -n 25 localhost >NUL 2>&1
exit