How to Delete a Locked File Using SDelete
One of Windows’ common issues is the inability to delete a file or folder if it is being used by another application. Usually, closing the blocking application solves the problem. However, identifying the culprit isn’t always easy.
In such cases, you can use a free utility from Microsoft called SDelete. However, you can’t use it as straightforwardly as other tools since it operates through the command line.
There are several commands you can use, allowing not only to delete a file but also to do so securely with multiple overwrites:
• -c: Clears free space.
• -f: Forces arguments containing only letters to be treated as files or directories rather than drives. This is not required if the argument includes other symbols (e.g., path separators or file extensions).
• -p: Specifies the number of overwrite passes (default is 1).
• -q: Quiet mode.
• -r: Removes the “read-only” attribute.
• -s: Executes recursively for subdirectories.
• -z: Zeroes out free space (useful for optimizing virtual disks).
• -nobanner: Suppresses the startup banner and copyright message.
This utility is powerful, but you’ll need to familiarize yourself with its commands for effective use.