Solved

Command to Delete All Files Permanently with No Prompt

Posted on 2014-01-08
3
5,226 Views
Last Modified: 2014-01-08
What parameters with the del command can I use to delete a folder, all of it's contents, for all file types (read-only, those with missing permissions, etc), permanently, and without a prompt to select yes or no.

Is this sufficient?

Del "Z:\FolderName" /f
0
Comment
Question by:fireguy1125
3 Comments
 
LVL 12

Accepted Solution

by:
ktaczala earned 500 total points
ID: 39766983
Use:

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

    /S      Removes all directories and files in the specified directory
            in addition to the directory itself.  Used to remove a directory
            tree.

    /Q      Quiet mode, do not ask if ok to remove a directory tree with /S
0
 
LVL 24

Expert Comment

by:aadih
ID: 39766990
/f is for force deleting of read-only files.

/q is for quiet mode, i.e., do not ask if ok to delete on global wildcard.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 39767253
if you dont have permissions to files it wont work still of course, will need to push permissions down and/or take ownership as usual.

steve
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A safe way to clean winsxs folder from your windows server 2008 R2 editions
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question