need to delete a file and then process further.
del file.html
echo ^<center^>^<a href="abc.html"^>ABC^</a^>^</center^> >> file.html
......
echo ^<center^>^<a href="xyz.com"^>XYZ^</a^>^</center^> >> file.html
at first time i got this message Could Not Find C:\Users\file.html but processed further to write into the file. I want to know, can it stop processing further at any stage if the file is not found to delete ?
According to this question – Can I have an IF block in DOS batch file? – DOS can do if branching via
And then from this MS Support article you can use
EXISTandNOT EXISTwith files. So my guess would be:Just by the bye, if you wanted to do this in bash (via Cygwin on Windows), it is rather easier as bash has more support for this stuff than DOS:
You appear to be appending things to the file, line by line. If there is no processing going on in these lines, you can just concatenate them using copy:
That offers the significant benefit that you separate the files containing the data from the script that is stitching them together.