Hi, is there any way I can change all files in a folder to zero-byte length? I need to have the same filenames, just want to change their size to zero. Maybe by creating a batch file.
Please help. Thanks.
How to change all files to zero-byte?
Moderator: DosItHelp
Re: How to change all files to zero-byte?
auaa
no idea what those could be good for
Take a FOR loop and overwrite each file with 0 byte.
Every found file will be a blank file, also links!
Regards
aGerman
no idea what those could be good for
Take a FOR loop and overwrite each file with 0 byte.
Code: Select all
@echo off &setlocal
set "folder=C:\anywhere"
pushd "%folder%"||goto :eof
for %%a in (*) do (
type nul>"%%a"
)
popd
Every found file will be a blank file, also links!
Regards
aGerman
Re: How to change all files to zero-byte?
Thanks a lot aGerman, you made my day brighter.
That is the codes that I looked for. It works !!
Actually, I have a program that always update/download new files into certain folders. Eventhough I deleted the old (not-needed files), but this program will always download the same files that I already deleted. That is why I need a way to make the files to zero-byte. This program will still see the files are availalable (although with zero byte), and it will not download the same files into this folder.
Thanks again.
That is the codes that I looked for. It works !!
Actually, I have a program that always update/download new files into certain folders. Eventhough I deleted the old (not-needed files), but this program will always download the same files that I already deleted. That is why I need a way to make the files to zero-byte. This program will still see the files are availalable (although with zero byte), and it will not download the same files into this folder.
Thanks again.