Delete the contents of files while keeping the zeroed out files

RodneyDickson

Distinguished
May 13, 2011
4
0
18,510
Hey now all,

I’ve been scouring the web for a solution to this little file problem of mine, and although I’ve found methods to do so in Linux and Unix, I am ultimately a Windows XP user and would love to find a method to accomplish this task in a Windows environment (I also have no idea how to perform these commands in Linux/Unix). I’m asking my question in the TomsHardware forum because from what I’ve read thus far on this forum, you guys seem to be the most apt at answering Windows-based questions:

What I would like to accomplish is the following: I have a directory with many .torrent files in it. The .torrent files range in file size from single digits to hundreds of kb’s each, and it’s starting to add up. What I would like to do, is to purge all of the content of the files (delete the data from them) while still retaining the file names (in essence, keeping a buncha .torrent files with no content, but with a filename for each of them and each weighing in a very little to no kb’s each). I know I can accomplish this by either editing each .torrent file in NotePad, deleting all of the content in the file, and saving, as well as by creating a bunch of empty text files and renaming them to the current names of the .torrent files, but I easily have hundreds of files, and this would take me a ridiculously long time.

Yes, my goal of this is to keep the files as .torrent files (creating a list of all of the filenames in one document is absolutely NOT what I am looking for here). If anyone has a method of doing this, I would be grateful.

Thanks in advance.
 
Well if you use a program such as Utorrent, it automaticly keeps all torrents that you previously downloaded but not the files it self normal size of 10-40kb each so nothing major to keep up with.
Only thing you would have to do if you needed to use them again is click them again and it would redownload them.
 
well on second of thought similar to what your already using but dont' think it would change anything since if you actually break open a torrent file it contains a list of it's trackers in someone of a text file so don't think you can edit them without making them usless. *if you open one of them with notepad you will notice at the header of the file it contacts a list of the trackers used to download the files second is the filler that gives the lists and commands for each of the files listed to be downloaded and the amount of pieces are broken down into. *
 
You may be able to do this with fsutil. The command to create a zero byte file is:

fsutil file createnew <file name> <size>

If you know batch programming or any programming, you could loop over the file names, create zero byte files of the same name in a new directory, delete the original torrent files, then move the zero byte files into the torrent directory.
 


Heh, sounds like a plan, but I have no idea how to program such a thing.
Thanks HawkEye

Anyone have any clue how to program such a thing?
 
look at bulk rename utility, I'm not 100% sure, but it might be able to copy the name of the torrent files you have and create new txt files with the same name allowing you to delete the torrent files in question.

otherwise as hawkeye said, you'd need to use batch processing to edit the torrent files. I'm not versed in using it so won't be able to help you. You might find some communities out there that would be willing to help you out for free or for a small fee
 


Good Idea AntiZig. Does anyone know of bulk rename software that can do just this?