Specifically, does type nul > somefile overwrite the entire file on disk? I saw a batch script website recommend generating an FTP script on the fly and then "securely" erasing it with the command in title. Is there any merit to this?
3 Answers
What does “type nul > somefile” do to “somefile” in Windows?
First,
somefileis opened for writing – this automatically causes the file to be truncated to 0 bytes. The data still remains on disk, just marked as "free" in the bitmapThen the contents of
nulare written tosomefile– in this case, exactly zero bytes, since you cannot read anything fromnul. The old data is not overwritten.The file is closed.
I saw a batch script website recommend generating an FTP script on the fly and then "securely" erasing it with the command in title. Is there any merit to this?
It's not any more "secure" than del somefile. It doesn't even remove the data from disk.
To erase a file securely, use a wipe utility such as sdelete or Eraser. Although, is a FTP script actually worth secure-wiping?
- 501,077