I'm looking to delete around 1.5 million files from my Z: drive, but I want to make sure that I don't accidentally delete any files from the folders on that drive. My system struggles with handling mass deletions. Is there a specific program or PowerShell command that can help with this?
3 Answers
Another way to handle this is by using the Command Prompt with admin rights. Open cmd as an admin, then type `Z:` followed by `del *`. This command will delete all files in the root folder of Z: without touching any folders or their contents. Just be cautious—it's permanent!
I was thinking, if Z: is just another drive, can't you right-click it in File Explorer and hit 'Format'? It sounds like it would wipe everything, but it would also delete the folders, right? (Edit: I see you mentioned you just want to clear files, so that wouldn't work!)
It looks like you're trying to clear out the root of your Z: drive without touching any subfolders. You can use the PowerShell command `Remove-Item *.*` to delete all files at the root level. Just keep in mind, this won't move them to the Recycle Bin; they'll be gone permanently! If you just want to delete files from that folder and not any subfolders, this should do the trick.
Yeah, formatting would wipe everything, including folders, so that wouldn't solve my problem. Thanks for your thoughts though!