How do I change file sizes to zero-byte?

December 2, 2019 at 01:39:28
Specs: Windows 7
I had a virus infection. As a result a lot of files were renamed with the "Adame" extension. Also the content of the files were changed making them unusable.

Now what I'd like to do is keep the files with their current names and zero out (or make tiny) their size.
Is there a way to do that in Total Commander or Explorer?


See More: How do I change file sizes to zero-byte?

Reply ↓  Report •

#1
December 2, 2019 at 15:55:03
Have you removed the ransomware from your system?
https://malwaretips.com/blogs/remov...

fsutil can write a number of ZEROs to an existing file or empty the file:
https://docs.microsoft.com/en-us/wi...

examples:

To set the valid data length to 4096 bytes for a file named Testfile.txt on an NTFS volume, type:
fsutil file setvaliddata c:\testfile.txt 4096

To set a range of a file on an NTFS volume to zeros to empty it, type:
fsutil file setzerodata offset=100 length=150 c:\temp\sample.txt


Reply ↓  Report •

#2
December 2, 2019 at 16:55:48
The c:\temp\sample.txt part is not clear.
In fact, I'd like to set zero data all the files in a single directory.
How do I specify that?

message edited by ymcolah


Reply ↓  Report •

#3
December 3, 2019 at 05:04:38
To set the valid data length to 1 bytes for a file named "your file.ext" on an NTFS volume, type:
fsutil file setvaliddata drive:\path\yourfile.ext 1

To set a range of a file on an NTFS volume to zeros to empty it, type:
fsutil file setzerodata offset=1 length=1 drive:\path\yourfile.ext


Reply ↓  Report •
Related Solutions


Ask Question