How to Delete a Folder in Windows from the Command Prompt
Information
This will show you how to permanently delete a Folder in Vista, Windows 7, or Windows 8 using the RD or RMDIR command from within a command prompt.
This can be handy if you cannot delete the folder using the normal methods.
Note
While you can run this command in a non-elevated or elevated command prompt, you would get the best results using a elevated command prompt.
Warning
The folder will be deleted immediately and not placed in the Recycle Bin first. Deleting a folder using this command will also delete all of it's contents as well as the folder. Be sure to backup anything you want to keep in the folder first.
EXAMPLE: RD and RMDIR Command NOTE:You can use either the RD or RMDIR command in the command prompt. They are the same command.
Here's How:
1. Do step 2 or 3 below for where you would like to use a command prompt at.
B) In the command prompt, type diskpart and press Enter. (see screenshot below)
C) In the command prompt, type list volume and press Enter. (see screenshot below) NOTE:This will let you see what the drive letter is for the drive that you want to delete the folder in since it may not always be the same drive letter that it is in Windows.
D) After making note of the drive letter, type exit and press Enter. (see screenshot below)
4. In the command prompt, type the command below and press enter. NOTE:Substitute Full Path of Folder within quotes below with your folder's full path within quotes instead.
Code:
RD /S /Q "Full Path of Folder"
NOTE: For example, if I wanted to delete a folder named Folder on my desktop, I would type this command below.
Code:
RD /S /Q "C:\Users\UserName\Desktop\Folder"
5. The folder should now be deleted.
6. Close the command prompt. NOTE:If you used a command prompt at boot, then also close the System Recovery Options window and restart the computer.
System Manufacturer/Model Number Lenovo Desktop H420 OS Windows 7 Ultimate (32 bit) CPU Intel i3 2100 Motherboard Lenovo LGA1155 MB Memory 4GB of DDR3 memory Graphics Card PCI-E NVIDIA GeForce 8500 GT Sound Card Build-in on MB Monitor(s) Displays Samsung 23" HD Model 2333 Screen Resolution 1920x 1080
Keyboard Who needs a keyboard? Mouse Logitech Laser G7 wireless PSU 450 Watt and some fans that blow Case Small tower Cooling Yes I am cool. lol Hard Drives C: Main Drive SATA 250GB
D:Backup Drive 500GB SATA Internet Speed Cable - Down 30 Mbps, UP 12 Mbps Other Info Motorola SB-6120 Cable modem DOC 3
Logitech Pro 9000 webcam
System Manufacturer/Model Number hp pavilion dv9700 OS windows 7 ultimate was Vista home premium Motherboard Quanta 30 d1 Memory 3072 MBs Graphics Card NVIDIA GeForce 7150M / nForce 630M Screen Resolution 1140 x 900
PSU AMD Turion 64 X2 Mobile Technology TL-60 2000 Mhz
System Manufacturer/Model Number Toshiba Satellite S875D-S7239 laptop OS MS Windows 7 Ultimate SP1 64-bit CPU AMD A10-4600M Motherboard AMD Pumori (Socket FT1) Memory 6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28) Graphics Card AMD Radeon HD 7660G Sound Card High Definition Audio Device Monitor(s) Displays Generic PnP Monitor (1600x900@60Hz) Screen Resolution 1600x900@60Hz
Keyboard Standard PS/2 Keyboard Mouse HP Wireless Optical Mobile Mouse Model FHA-3410 Hard Drives SSD 119GB Corsair CSSD-V128GB2 ATA Device Internet Speed What the local pub, local coffee shop offers. Other Info Optical Drive:MATSHITA BD-CMB UJ160B ATA Device
Also have an Asus ha1002xp netbook with Win 7 Ultimate installed.
For only the C:\User\(user-name) location, that would be fine.
I just used the normal full path version since it would be a better example for all situations. Plus, the %path% may not work so well if a command prompt at boot is used. That's all.
System Manufacturer/Model Number Toshiba Satellite S875D-S7239 laptop OS MS Windows 7 Ultimate SP1 64-bit CPU AMD A10-4600M Motherboard AMD Pumori (Socket FT1) Memory 6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28) Graphics Card AMD Radeon HD 7660G Sound Card High Definition Audio Device Monitor(s) Displays Generic PnP Monitor (1600x900@60Hz) Screen Resolution 1600x900@60Hz
Keyboard Standard PS/2 Keyboard Mouse HP Wireless Optical Mobile Mouse Model FHA-3410 Hard Drives SSD 119GB Corsair CSSD-V128GB2 ATA Device Internet Speed What the local pub, local coffee shop offers. Other Info Optical Drive:MATSHITA BD-CMB UJ160B ATA Device
Also have an Asus ha1002xp netbook with Win 7 Ultimate installed.
System Manufacturer/Model Number baarod/MCP OS Windows 7 Ultimate 64-bit CPU Core2 Quad Q6600 @ 3.6GHz 9x400FSB Motherboard Gigabyte G33M-S2H Memory 4GB DDR2 1066 Graphics Card ATI Radeon HD 4670 Sound Card Integrated Azalia Monitor(s) Displays Acer AL1711 Screen Resolution 1280x1024
Keyboard Microsoft Wireless Comfort Keyboard 4000 Mouse Microsoft Wireless Lasr Mouse 5000 PSU 240W TFX Case InWin BT566 Cooling Intel Retail Stock Hard Drives OCZ Vertex SATAII w/ 1.5FW 30,528MB system and apps
Maxtor 6L300R0 PATA 286,188MB page file, data and user profiles Internet Speed 3Mbps Verizon DSL over 802.11g Other Info Hauppauge WinTV PVR II Tuner, Generic $13 SoC Webcam, RT61 WiFi with remote antenna, Media Center Remote and Receiver