New
#1
reading file in windows batch
i have a file b.txt with entries like :
explorer.exe pid: 3136 type: File A24: D:\ftproot\logs\tagswap
notepad.exe pid: 7732 type: File 18: D:\ftproot\logs\tagswap
I want to read each record and extract pid and kill it.
The following is only giving me only one record .
for /f "tokens=4 delims= " %%G in (c:\temp\b.txt) do (
SET KILLPIDSTR=%%G
SET KILLPIDSUBSTR=%KILLPIDSTR:~24,5%
echo %KILLPIDSUBSTR%
)