Download the Tom's Hardware App from the App Store
The reference for current tech news
Yes No
Ads
Tom's Hardware > Forum > Windows XP > Configuration & Customization > Delete the contents of files while keeping the zeroed out files

Delete the contents of files while keeping the zeroed out files

Forum Windows XP : Configuration & Customization Delete the contents of files while keeping the zeroed out files

Word :    Username :           
 

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.

Reply to RodneyDickson
Register or log in to remove.

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.

Reply to TitusFFX

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. *

Reply to TitusFFX

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.

Reply to Hawkeye22

Hawkeye22 wrote :

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?

Reply to RodneyDickson

Oh it's a windows filesystem command script build into eithe powershell or the standard command line

http://technet.microsoft.com/en-us [...] S.10).aspx

here is an example page to show different methods that it can be used...

http://ss64.com/nt/fsutil.html

Reply to TitusFFX

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

Reply to AntiZig

AntiZig wrote :

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?

Reply to RodneyDickson

Here is a good one and it's free to use.

http://www.bulkrenameutility.co.uk/Download.php

Also there is instructions on the same page to also help out

Reply to TitusFFX
Register or log in to remove.
Tom's Hardware > Forum > Windows XP > Configuration & Customization > Delete the contents of files while keeping the zeroed out files
Go to:

There are 1978 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
  • Ask the community now
  • Publish
Ad
Ads
Latest best answer
Password
By ksiemb, 15 hours ago:


Cannot help with password retrieval. - Forum Rules.

Best offers
They won a badge
Join us in greeting them
Top experts