i have a batch script which i use to merge all the same name txt files from directories & subdirectories into one, here's my code:
@echo off
for /f "tokens=*" %%a in (textfilenames.txt) do (
for /D /R %%I in (%%a.txt) do (
type "%%I" >> merged.tmp
echo. >> merged.tmp
)
ren merged.tmp All_Combined_%%a.txt
)
)
@pause
and so when the loop doesn't finds the file on some directories then this msg is displayed:
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
Press any key to continue . . .
and i wanna hide above error and so i used >NUL in file name eg:
@echo off
for /f "tokens=*" %%a in (textfilenames.txt) do (
for /D /R %%I in ('%%a.txt^>NUL') do (
type "%%I" >> merged.tmp
echo. >> merged.tmp
)
ren merged.tmp All_Combined_%%a.txt
)
)
@pause
but i'm still getting error msg, i want to make this script completely silent like no error nothing or if somehow it's not possible then i wann customize the error to something like:
The system cannot find the example.txt specified. in the \Subfolder\Enigma\
etc!