Solved Batch script to parse file name and nullify

July 8, 2015 at 03:04:01
Specs: Windows Server
Hello,

I have a directory with 60 files in it. I need to empty the contents of the files on daily basis, without deleting the files. I figure maybe I need to parse thhe full filename and CALL a subroutine to run "type nul > <parsedFilename>. I can't figure out how to do this...any help would be much appreciated..


See More: Batch script to parse file name and nullify

Report •


#1
July 8, 2015 at 09:13:34
✔ Best Answer
Assuming this directory only holds the 60 files you want to wipe:
FOR %%a IN (C:\some\dir\*) DO COPY NUL "%%a"

How To Ask Questions The Smart Way

message edited by Razor2.3


Report •
Related Solutions


Ask Question