Key | Value |
---|---|
Author | Phil McCaffrey [email protected] |
Created Date | Wed Aug 11th, 2021 @ 17:50:24 |
OS Compatibility | Tested on |
- Windows 10
- Sever 2012/2016 |
For a given path (a.k.a. Folder)... quickly, recursively and permanently delete all files and folders within it.
In Windows, deleting a tremendous amount of files (i.e. 2 million files or 1.5 tb worth of files) can be done in a number of ways. Unfortunately, most of the easy/available ways that the "average Windows User"* would attempt it will take a ridiculously long time and may have multiple failures or problems.
In the "Command Line" there are a few fast and reliable options available to those who are both aware of them as well as familiar and comfortable using a cli. Given the inherent destructive nature of deletion, combined with the lack of safety net in the CLI, is a recipe for disaster.
- "average Windows User" is respectfully defined as those who dont know or are not comfortable with the CLI (Command Prompt, PowerShell, etc.)
TLDR: The purpose of this script is to provide safe, convenient, dead-simple access to the best and fastest tools Windows offers for deleting a tremendous amount of files.
It would be very wise to fully read and understand this entire page before doing anything.
- Download this script onto Windows computer/server containing files/folders needing to be deleted
- Open "File Explorer" and navigate to where the script has been downloaded
- Run the script by right clicking it and going to "Run as Administrator"
- A new "Command Prompt" will launch and details of the system executing the script will be shown
- The purpose of showing the system details is to allow the user to confirm script is being executed on the expected/desired system. Absolutely no data is extracted, logged, or transmitted anywhere in this script
- When prompted, Type or "Paste" the full path of the folder to be deleted (i.e. c:\sandbox\someFiles), then press enter
- A prompt will be shown to confirm the path/folder to be deleted.
- If the prompted path is EXACTLY as expected/desired, press 'Y'... otherwise press 'N'
- This script provides no ability to "selectively" delete (or not-delete) within the given "path". EVERYTHING in and "under" the path/folder specificed will be irrevocably deleted. There is no "Recycle Bin" or "Undo" possibility once the deletion process is confirmed then executed
- The path shown in the confirmation prompt (Step 7 above) is the "scripts" understanding of the path input by the user, and the path that will in fact be deleted. Usually what the user enters and what the "script understands" will be the same thing, but there are certain situations that may not be the case.
- This script is provided at no cost, as my gift to you/humanity. FWIW, I wish it was a nicer gift too...
- Although I have every reason to believe it will work as expected, I take no responsibility for using it or any possible outcome of doing so. In fact, if we're getting all legal about it, my advice is not to use this for any reason under any circumstance. 2.1. If needed, I will happily provide a full money-back guarantee... which is of course nothing. 2.2. All refunds will be made in Wompum, Monopoly Money, or other as decided by me
- Where required by law, and with irrefutable proof, I accept liability of $0.0000000000000000001 3.1. To be accepted, proof must be accomponied by a picture containing at least 3 chickens, a unicorn, a mime, and the original output of the script rendered through a monitor which was made before 1953
- Be awesome and make the world a better place