Remove directory Issues

Tuck

New member
Local time
3:29 AM
Messages
8
Hi,

I'm recovering from a nasty hard drive crash and I need to delete some corrupted directories. I'm encountering a problem when using Rmdir(rd) on a specific folder. In an elevated command prompt I type,

RD /S /Q "G:\Folder\Folder\TargetDirectory"

but even with the /s switch I still get the "The directory is not empty." message for each subfolder within the directory. I have also tried shift+delete and deleting in safe mode to no avail. Thanks for any response.

-Tuck
 

My Computer

OS
Windows 7 Professional x32

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
Thanks for the quick response,

I tried deleting from the safe mode command prompt, but I encountered a similar problem. The command prompt listed each subfolder and for each it said "The directory is not empty," except for the last one where it said "The request could not be completed because of an IO error."

-Tuck
 

My Computer

OS
Windows 7 Professional x32
Safe Mode is not at boot. Give it a try it from a command prompt (click on link) opened using your retail Windows 7 installation DVD instead.
 

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 booted from the install disc and entered the command prompt. Upon trying to change to the drive with the undesired directory in it, by typing "G:", I received the message "the system cannot find the drive specified." The drive is external, which I should have mentioned before, but I don't know if that would make a difference.

Thanks,
Tucker
 

My Computer

OS
Windows 7 Professional x32
Ah, I see.

See if you may be able to manually delete the contents of each subfolder in the TargetDirectory, then see if you may be able to delete the TargetDirectory.
 

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 can also try running chkdsk g: /f against that drive to see if it fixes any file system errors.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
I booted from the install disc and entered the command prompt. Upon trying to change to the drive with the undesired directory in it, by typing "G:", I received the message "the system cannot find the drive specified." The drive is external, which I should have mentioned before, but I don't know if that would make a difference.

Thanks,
Tucker
You are aware that drive letters "change" when booting from system repair or install disk?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Own build
OS
Windows 7x64 Home Premium SP1
CPU
Intel i7 2600k
Motherboard
ASUS P8Z68 Deluxe
Memory
G.Skill Ripjaws (DDR3-1600) 2x4GB
Graphics Card(s)
Nvidia GeForce GTS 450; Intel HD Graphics 3000(GT2+)
Monitor(s) Displays
Dell Ultrasharp IPS panel U2311H, Samsung SyncMaster P2350
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro SSD 256GB, Samsung SSD 840 120GB, Seagates 1TB Barracuda ST31000528AS x2
PSU
Seasonic M12II 520W
Case
Lian Li Lancool PC-K60
Cooling
Case: 1x120mm, 3x140mm CPU: Hyper 212+
Keyboard
Logitech MK520 (wireless)
Mouse
Logitech MK520
Internet Speed
6-7 Mbps
Antivirus
Norton Security Premium, Malwarebytes on 2 (MSE on 3rd PC)
Browser
FireFox
Other Info
Audio: Logitech Z523 2.1
In response to Brink: If I try to open the subfolders, explorer freezes up for ten minutes or so and then displays the message "You need to format the disk G: before you can use it. Would you like to format it?" If I try to delete the subfolders themselves, even outside of the command prompt, I still get the "This directory is not empty," message.

In response to Ztruker: I have tried running chkdsk /f /r, which hangs in step 2 while discovering indexes.

In response to mjf: I do not understand what you mean. I noticed that the command prompt started in the X: drive, but I could switch to my C: drive with no issue. Would other drives letter's change?

Thanks to everybody for their suggestions,
Tuck
 
Last edited:

My Computer

OS
Windows 7 Professional x32
I thought earlier Brink was talking about booting from your install DVD or System Repair DVD. Then you get an X: prompt.
Windows is not being booted by your HDD. It's using the Winre version of windows on your boot disk.
Most of the drive letters will not coincide with what they are normally when you do a normal boot. In your case C: appears to coincide.

At the X:\...\ prompt
type
>diskpart
>list volume
then you get a list of drive letters next to the label descriptions. Your external (G:will probably have another letter assigned. This is the letter you use until you eventually reboot back into normal Windows 7.
> exit
get you back to
X:\....\
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Own build
OS
Windows 7x64 Home Premium SP1
CPU
Intel i7 2600k
Motherboard
ASUS P8Z68 Deluxe
Memory
G.Skill Ripjaws (DDR3-1600) 2x4GB
Graphics Card(s)
Nvidia GeForce GTS 450; Intel HD Graphics 3000(GT2+)
Monitor(s) Displays
Dell Ultrasharp IPS panel U2311H, Samsung SyncMaster P2350
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro SSD 256GB, Samsung SSD 840 120GB, Seagates 1TB Barracuda ST31000528AS x2
PSU
Seasonic M12II 520W
Case
Lian Li Lancool PC-K60
Cooling
Case: 1x120mm, 3x140mm CPU: Hyper 212+
Keyboard
Logitech MK520 (wireless)
Mouse
Logitech MK520
Internet Speed
6-7 Mbps
Antivirus
Norton Security Premium, Malwarebytes on 2 (MSE on 3rd PC)
Browser
FireFox
Other Info
Audio: Logitech Z523 2.1
That's the main reason I name my drives/partitions as I do. It's a Dell Precision 370. When Win 7 is booted, they are:

D370_C (C: )
D370_D (D: )
D370_E (E: )
D370_F (F: )
D370_G (G: )
D370_H (H: )

That way I know no matter what actual drive letter is assigned in other environments, D370_C is always my Win 7 C: drive, etc.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
It turns out that the drive letter did change, however I was still unsuccessful in deleting the folder from the installation disk command prompt. I think I'm just going to have to format the thing. Thanks to everybody who helped.
 

My Computer

OS
Windows 7 Professional x32
It might have been interesting to see if the super hidden administrator account made any difference.
Hidden Administrator

Certainly not an account for day to day use.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Own build
OS
Windows 7x64 Home Premium SP1
CPU
Intel i7 2600k
Motherboard
ASUS P8Z68 Deluxe
Memory
G.Skill Ripjaws (DDR3-1600) 2x4GB
Graphics Card(s)
Nvidia GeForce GTS 450; Intel HD Graphics 3000(GT2+)
Monitor(s) Displays
Dell Ultrasharp IPS panel U2311H, Samsung SyncMaster P2350
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro SSD 256GB, Samsung SSD 840 120GB, Seagates 1TB Barracuda ST31000528AS x2
PSU
Seasonic M12II 520W
Case
Lian Li Lancool PC-K60
Cooling
Case: 1x120mm, 3x140mm CPU: Hyper 212+
Keyboard
Logitech MK520 (wireless)
Mouse
Logitech MK520
Internet Speed
6-7 Mbps
Antivirus
Norton Security Premium, Malwarebytes on 2 (MSE on 3rd PC)
Browser
FireFox
Other Info
Audio: Logitech Z523 2.1
It turns out that the drive letter did change, however I was still unsuccessful in deleting the folder from the installation disk command prompt. I think I'm just going to have to format the thing. Thanks to everybody who helped.

What did it say when you tried deleting 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
The system could not find the folder specified. See the event log for details or something to that effect.
 

My Computer

OS
Windows 7 Professional x32
Tuck,

Do you have enough free space to temporarily copy everything on the corrupted drive that you want to keep to another drive/partition? Afterwards, format the currupted drive and copy everything back.
 

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 could have some really nasty corruption going on.

I don't know how adept you might be, But i can tell you that a Linux Live CD would probably delete those folders.
That is if they actually exist. ... they could be (not saying they are) ghost directories that are stuck out there and may not actually exist... cause by really nasty corruption.
Chkdsk could help remedy that issue. But if not, you may need to take more drastic measures...

One of those being... back up what data you can,,, then Nuke and reload.

Or......

If you are adept enough to learning,,,, you could try Puppy Linux Live CD.

Just download the latest release lupu-511.iso and burn to CD
Then boot your system with the CD like you would 7
just let the boot process go till you either get to a prompt (just select US or English) this is just language keyboard locations stuff
you may also have to select video resolution. just read what it says and follow the instructions.

Or it may just boot you right into the OS.

Then you will see an Icon called Mount,,,, click it once
There you should see your Drive or drives
You will have to mount each one to find what you are looking for or try going by size, or generally they will be listed in order like....

sda1 = C: (the boot drive)
sda2 = D: (the OS drive)
sda3= E: (other drive)

etc. or something similarly equal to that.

Then you can try right clicking those folders and find delete and delete then choose Quiet.
They should disappear.

Why?

Cause Linux does handle these things differently. It ignores much of the problems that Windows does not.
Linux is a good tool to have for situations just like this one.


Personally,, in these situations,, I would recommend the following very highly....

Back up data.....
Get Hard Drive Diags from Manufacturer
Run the diags a couple of times, just to be sure that there are not problems with the drive/drives themselves.
Format and reload windows from scratch.

If you have this kind of crazy corruption, there is no telling what else could be happening or might happen later
 

My Computer

Computer Manufacturer/Model Number
Self Built
OS
Win 7 Ultimate 32bit
CPU
C2D E6600 2.4Ghz
Motherboard
Intel D965WH
Memory
4G Kingston KHX5400D2
Graphics Card(s)
EVGA GTX 570 HD SC (012-P3-1573-KR)
Sound Card
On-Board
Monitor(s) Displays
Samsung 226BW
Screen Resolution
1680 x 1050
Hard Drives
2 x 250 Seagate Barracuda
2 x 500 Seagate Barracuda (Raid1)
PSU
Corsair TX750W
Case
In-Win C589
Cooling
Stock Intel Cooling
Ha I'm actually in the process of doing that now. I'm still encountering errors here and there, but these ones are more google-able.
 

My Computer

OS
Windows 7 Professional x32
Thanks for the suggestions Tepid, however, formatting seems so much easier at this point. I've already sunk enough hours of my life into this mess.
 

My Computer

OS
Windows 7 Professional x32
hahaha,.,,, yeah, you might want to refresh the screen and re-read my post,, I edited and added stuff,, sorry,, bad habit of mine.
 

My Computer

Computer Manufacturer/Model Number
Self Built
OS
Win 7 Ultimate 32bit
CPU
C2D E6600 2.4Ghz
Motherboard
Intel D965WH
Memory
4G Kingston KHX5400D2
Graphics Card(s)
EVGA GTX 570 HD SC (012-P3-1573-KR)
Sound Card
On-Board
Monitor(s) Displays
Samsung 226BW
Screen Resolution
1680 x 1050
Hard Drives
2 x 250 Seagate Barracuda
2 x 500 Seagate Barracuda (Raid1)
PSU
Corsair TX750W
Case
In-Win C589
Cooling
Stock Intel Cooling
Back
Top