Folder - Delete from Command Prompt

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.
About_RD_RMDIR.jpg




Here's How:
1. Do step 2 or 3 below for where you would like to use a command prompt at.


2. To Use a Elevated Command Prompt in Windows
A) Open an Elevated command prompt in Vista/Windows 7 or Windows 8, and go to step 4 below.
3. To Use a Command Prompt at Boot
A) Open a command prompt at boot in Vista/Windows 7 or Windows 8, and go to step 4 below.

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)
Command-1.jpg
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 "[COLOR=red][B]Full Path of Folder[/B][/COLOR]"

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"
Elevated_Command_Prompt.jpg
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.
That's it,
Shawn




 
Last edited:
Sadly this, nor any other method I've found from searching Google for the last 2 hours, has helped me with my problem. I was downloading music from Sound Cloud and one of the files showed up as... empty... blank... (I'm not overly tech-savvy so I don't know exactly what to call it). It shows as 0 bytes on the Properties tab, and when I try to delete it (from my Downloads folder on Win8.1) it says Could not find this item. I also get this or at least a similarly worded error whenever I try to move it or rename it, and when I try to cut and paste it nothing happens and the same with when I try to shred it with Tune Up Utilities shredder. I have restarted my computer multiple times, refreshed the page (where it shows my downloads), gone into Safe Mode and tried everything, used CMD multiple different ways, tried using a program I saw linked in another thread about this called Unlocker of which wouldn't download because it was blocked by my computer because it could contain a virus.................................. NOTHING is removing this da*n thing! Please help! :mad:
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Acer Aspire E5-521
OS
Windows 8.1 x64
Memory
4.00 GB (3.21 GB usable)
Graphics Card(s)
AMD Radeon R2
Antivirus
AVG 2015 Free
Browser
Mozilla Waterfox (64bit version of Firefox)
Hello Diaa, and welcome to Seven Forums.

If you have a 3rd party AV program that blocked the file, then check to see if that program has an option to delete it from quarantine.

If not, then you might see if the free program Unlocker or FileASSASSIN may be able to delete it for you. :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Hello Diaa, and welcome to Seven Forums.

If you have a 3rd party AV program that blocked the file, then check to see if that program has an option to delete it from quarantine.

If not, then you might see if the free program Unlocker or FileASSASSIN may be able to delete it for you. :)

Thanks, I actually just made my account to look for help since nothing is working.

Which file are you referring to? The one that won't delete, or the download file for Unloker? Nothing has been blocked, as far as I know, other than the download for Unlocker, and that block was from my browser, not my antivirus. I will try FileASSASSIN now, though. I'll post results as soon as I try it. Thanks.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Acer Aspire E5-521
OS
Windows 8.1 x64
Memory
4.00 GB (3.21 GB usable)
Graphics Card(s)
AMD Radeon R2
Antivirus
AVG 2015 Free
Browser
Mozilla Waterfox (64bit version of Firefox)
*Sigh...* How is my stupid computer not finding it when I'm sitting right here looking at it? And better yet, why is this thing not going away no matter what I do?!!!
 

Attachments

  • Untitled.png
    Untitled.png
    151.4 KB · Views: 107

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Acer Aspire E5-521
OS
Windows 8.1 x64
Memory
4.00 GB (3.21 GB usable)
Graphics Card(s)
AMD Radeon R2
Antivirus
AVG 2015 Free
Browser
Mozilla Waterfox (64bit version of Firefox)
I was referring to the blocked file.

Are you able to rename the file, or drag it to your desktop to hopefully be able to delete it afterwards?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
I was referring to the blocked file.

Are you able to rename the file, or drag it to your desktop to hopefully be able to delete it afterwards?

I already stated in my first post that I was not able to do either. Absolutely nothing is working to get rid of it or alter it in any way.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Acer Aspire E5-521
OS
Windows 8.1 x64
Memory
4.00 GB (3.21 GB usable)
Graphics Card(s)
AMD Radeon R2
Antivirus
AVG 2015 Free
Browser
Mozilla Waterfox (64bit version of Firefox)
i have a file on my desktop that wont delete ive tried everything here but it just wont delete please help, thanks in advance.
here is the path its on C:\Users\Rob\Desktop\this folder
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
windows 7 ultimate x64
Antivirus
Avast Premier 2015
Hello Bob, and welcome to Seven Forums.

In that case, you might see if the free program Unlocker or FileASSASSIN may be able to delete it for you. :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
neither one works they both say doesnt exist
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
windows 7 ultimate x64
Antivirus
Avast Premier 2015
In that case see if it may go away after refreshing (F5) your desktop or restarting the computer.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
tried that before joining here didnt fix either:confused:
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
windows 7 ultimate x64
Antivirus
Avast Premier 2015

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
you want a screenshot of my desktop ? its just a folder sitting on my desktop, had pictures in it for a soccer game i play online, i went to the forum where i downloaded the file and others have said they cant delete it either...hmm
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
windows 7 ultimate x64
Antivirus
Avast Premier 2015
The screenshot was to determine if it may have been a folder added by the system or not.

Since it's not, see if you are able to open it. If so, delete the contents from inside the folder first, then see if you are able to delete the folder.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
it says cannot find the item, this is no longer located in C:\Users\Rob\Desktop\this folder when i try to delete the folder
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
windows 7 ultimate x64
Antivirus
Avast Premier 2015
In that case, I'd also contact the forum where you got it from to see if they may have a solution since others have the same issue with their download.

As a test to see if this may reset it, right click on your desktop and click on View -> Auto arrange icons to toggle it on and off.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
i have done, they got nothing thats why im searching myself, and the view icon thing didnt work either
appreciate your help
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
windows 7 ultimate x64
Antivirus
Avast Premier 2015
Ok. Let's see if deleting the two hidden desktop.ini files on your desktop, and restarting the computer afterwards will remove this ghost folder then. If there's a reference entry in one of the desktop.ini files for this folder, then this should clear it.

You'll need to first temporarily set Windows to show hidden OS files using step 5 in OPTION ONE of the tutorial below.

http://www.sevenforums.com/tutorials/394-hidden-files-folders-show-hide.html
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
ok i always have show hidden files selected anyway, where would the desktop.ini be ?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
windows 7 ultimate x64
Antivirus
Avast Premier 2015
sorry i deleted them, but didnt do anything still cant delete it
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
windows 7 ultimate x64
Antivirus
Avast Premier 2015
Back
Top