NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
jonnymorris98
Dec 17, 2020Tutor
Can I restore only good files from backup USB disk to overwrite zero byte files?
Just checking through my C volume I noticed some folders contain zero byte files, the time stamp is 2018 (all files in a folder have the exact same time and date) so I don't think this has anything t...
StephenB
Dec 17, 2020Guru - Experienced User
jonnymorris98 wrote:
Also is there a way of finding all folders / files of zero bytes?
You can do this on a windows PC that has access to the shares using powershell. This command will do it:
gci -rec -force -path \\nasname\sharename | foreach-object { if($_.length -eq 0) { write-host ("{0}" -f $_.FullName) } }
Use the real nas name (or IP address) and share name of course. If the USB disk is connected to the PC, you can use the Windows path to the USB folder instead of \\nasname\sharename
You can write this to a file (for example output.txt) by adding
*> .\output.txt
to the end of the command.
I'm not sure if this will report zero-byte folders or not (I don't have any easy way to test that).
jonnymorris98
Dec 17, 2020Tutor
StephenB wrote:
jonnymorris98 wrote:
Also is there a way of finding all folders / files of zero bytes?
You can do this on a windows PC that has access to the shares using powershell. This command will do it:
gci -rec -force -path \\nasname\sharename | foreach-object { if($_.length -eq 0) { write-host ("{0}" -f $_.FullName) } }
This is proving to be very useful and time-saving, thank you very much!
It's odd the way only a few folders have zero byte files in them, and when they are affected it's not always all files, it might be all of them or it might be from part way down the list (sorted by name).
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!