Tech Support Forum banner

Delete & remake empty text files

891 Views 2 Replies 2 Participants Last post by  wahlroot
I have a Batch File that deletes some text files at bootup in some applications. These empty text files are remade when the application is started. This is the line that I use to do this.
DEL /s /q "C:\PROGRA~1\Application\File.dat"
This slows the application startup. I would like to have the empty text files remade by the batch file during bootup. I tried this after the DEL Line but it did not work.
copy "C:\Folder\File.dat C:\PROGRA~1\Application"
Is this possible. If so, how.
Not open for further replies.
1 - 3 of 3 Posts
Try this:

" " > C:\PROGRA~1\Application\file.dat
as a command typed from the prompt, it gives an error but it does actually make the file and put nothing into it. As an added bonus, you don't need to use the delete command either, as this in effect deletes the original file anyway.
I made my batch file lines as follows, and it seems to work. Replaces the .dat files with other empty ones I had placed in the C:\folder. I had to remove the quotation marks before C and afterApplication. do not know why.
copy /y C:\Folder\File.dat C:\PROGRA~1\Application
1 - 3 of 3 Posts
Not open for further replies.