dos command needed
-
-
I am making a batch file and l need to clear the contents of a file that always gets written with some data and the project does not compile. I need a way to clear the file or delete the file and recreate the file empty any ideas ? Thanks in Advance
manually create an empty file (only need to do it once) and then copy it to the file you want to clear out within the batch file (or you can do it within a makefile) Steve
-
I am making a batch file and l need to clear the contents of a file that always gets written with some data and the project does not compile. I need a way to clear the file or delete the file and recreate the file empty any ideas ? Thanks in Advance
echo. > filename.ext
That will actually write \r\n to the file, instead of making it 0 bytes. If you must have it be 0 bytes, you could grab a port of the Unix command "touch".--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
I am making a batch file and l need to clear the contents of a file that always gets written with some data and the project does not compile. I need a way to clear the file or delete the file and recreate the file empty any ideas ? Thanks in Advance
copy nul emptyFile
-
copy nul emptyFile