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:
I meant my entire problem, not just the use of an elevated command prompt.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba
OS
Windows 8 64 bit
CPU
AMD E2-1800 APU 1.7GHz
Motherboard
Unknown
Memory
4 GB (3.59 GB usable)
Graphics Card(s)
Radeon HD graphics
Hard Drives
Unknown
Antivirus
Avast
Browser
Chrome
I don't know if I'm doing it right.It just says:
The system cannot find the file specified.
I followed you're instructions correctly. Am I doing something wrong? I also used a elevated command prompt, but it still gives me the same response.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
asus
OS
Windows 7 Home Premium 64 bit
I meant my entire problem, not just the use of an elevated command prompt.

Were you able to delete the two folders using an elevated command prompt?

If not, then yes please give full details.
 

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 don't know if I'm doing it right.It just says:
The system cannot find the file specified.
I followed you're instructions correctly. Am I doing something wrong? I also used a elevated command prompt, but it still gives me the same response.

Hello MLBFalcon, and welcome to Seven Forums. :)

Did you use the correct full path of the folder?

Which option are you using? If you are using a command prompt at boot, the drive letters are not always the same at boot as they are in Windows.
 

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
Well, this folder is extremely stubborn. Here is my process and sorry for the length of this post:

I tried deleting it first.
Screenshot_1_.jpg

It failed.
Screenshot_2_.jpg

I then tried using a command prompt to delete it.
Screenshot_3_.jpg

That failed too.
Screenshot_4_.jpg

I created a batch file; one that was recommended to someone with a similar issue to me.
Screenshot_5_.jpg

This one did not work.
Screenshot_6_.jpg

I decided to break out the big guns: the elevated command prompt.
Screenshot_7_.jpg

Nope, still there.
Screenshot_8_.jpg


What do?
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba
OS
Windows 8 64 bit
CPU
AMD E2-1800 APU 1.7GHz
Motherboard
Unknown
Memory
4 GB (3.59 GB usable)
Graphics Card(s)
Radeon HD graphics
Hard Drives
Unknown
Antivirus
Avast
Browser
Chrome
Stubborn indeed. If you like, see if the free program Unlocker may be able to delete it.
 

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
Hey guys, guess what.
Screenshot (9).png

Didn't work either.
Screenshot (10).png
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba
OS
Windows 8 64 bit
CPU
AMD E2-1800 APU 1.7GHz
Motherboard
Unknown
Memory
4 GB (3.59 GB usable)
Graphics Card(s)
Radeon HD graphics
Hard Drives
Unknown
Antivirus
Avast
Browser
Chrome
If you click on Yes in the second screenshot, does it delete it for you then?
 

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
Nope, still here after reboot.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba
OS
Windows 8 64 bit
CPU
AMD E2-1800 APU 1.7GHz
Motherboard
Unknown
Memory
4 GB (3.59 GB usable)
Graphics Card(s)
Radeon HD graphics
Hard Drives
Unknown
Antivirus
Avast
Browser
Chrome
See if you are able to rename the "New Folder" folder, and be able to delete it afterwards.

If not, see if you are able to delete the contents of the folder, then see if you are able to delete the folder.

If still not, take ownership of the folder, and see if you are able to delete it afterwards.

http://www.sevenforums.com/tutorials/1911-take-ownership-shortcut.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
I created the folder to hold some pictures I took. Right after I put the pictures into the folder, I tried to rename it and ran into the problems about not having permission. I moved the pictures to another folder (Which I was able to rename so I don't believe it was the pictures' fault) and tried to delete the folder. That's when I came here.

I just tried renaming it again. For some reason it worked. I renamed to "please go away" (without the quotes). I was then able to delete it without any problem. I have no clue why it let me rename it this time; I have tried at least two other times to rename this empty folder.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba
OS
Windows 8 64 bit
CPU
AMD E2-1800 APU 1.7GHz
Motherboard
Unknown
Memory
4 GB (3.59 GB usable)
Graphics Card(s)
Radeon HD graphics
Hard Drives
Unknown
Antivirus
Avast
Browser
Chrome
Yes, I did use the correct full path. I also used elevated.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
asus
OS
Windows 7 Home Premium 64 bit
I created the folder to hold some pictures I took. Right after I put the pictures into the folder, I tried to rename it and ran into the problems about not having permission. I moved the pictures to another folder (Which I was able to rename so I don't believe it was the pictures' fault) and tried to delete the folder. That's when I came here.

I just tried renaming it again. For some reason it worked. I renamed to "please go away" (without the quotes). I was then able to delete it without any problem. I have no clue why it let me rename it this time; I have tried at least two other times to rename this empty folder.

Great news. :party:
 

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
Yes, I did use the correct full path. I also used elevated.

Please go ahead and post a screenshot showing what's in the command prompt to see if it may reveal anything.
 

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
uh how do i do that? cause you know im new to this.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
asus
OS
Windows 7 Home Premium 64 bit

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
Well I hope you know what a batch file is, Englishbob, because you are going to create the following batch file --
Code:
rd /s /q \\?\%1
Drag this undeletable folder of yours onto the batch file, then delete the batch file.

had the same problem, i would get a folder not found error, i gave up about a month ago.
a friend of mine just had the same problem, and i figured i'll try to find a solution, read through this entire thread, nothing worked, except for the above solution. and wala the folder disappeared, i have tried other forums, and nothing, should have known, no-one compares to windows forum :D:D

thank you very much "Pyprohly"
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
surface pro 1
OS
windows 8.1 pro
CPU
Intel Core i5
Memory
4096 MB
Screen Resolution
1920 x 1080 x 59 hertz
Hey Guys

Just found your website!! And I need a hand with my problem:

I had Win7 Ulti 64bits installed on a HDD and recently I acquired a SDD and installed anew the OS.

Now I have the HDD slaved and there are several folders I just CANT delete.

Ive tried everything: Manual delete, Secure mode, Hardwipe software and CMD deleting and only few files are left. Everytime I want to delete them Im told I dont have permissions but my user is the administrator.

Can you please tell me how to permanently delete those files? they all are old win files and they weight a lot.

Thanks in advance!!

Sigma
 

My Computer

Computer type
PC/Desktop
OS
WIn 7 Ultimate 64bts
Hello Sigma, and welcome to Ten Forums. :)

If you like, the free program Unlocker may be able to help you delete them.

Unlocker Download
 

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
Removing an unwanted file folder

I have tried this several ways...and it doesn't work for me. I have an unwanted folder under Libraries, Pictures, My Pictures that I can't get rid of. I'd be happy to let you work with me on TeamViewer or VNC if you want to look at it. Greg
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
Windows 7 Home Premium 64 bit
CPU
Intel Core i7 [email protected] GHz
Memory
8 GB
Hard Drives
454 GB RAID
Antivirus
Trend Micro Internet Security
Browser
Chrome or I.E. 11
Back
Top