Remove Directory from Command line, Access is denied, The directory is not empty

  • Thread starter Thread starter Dennis W. Bulgrien
  • Start date Start date
D

Dennis W. Bulgrien

I had trouble removing a Windows installed directory from the command line. The
causes, it was marked read-only and contained a hidden/system file. Here's how
I solved it.

C:\>del "C:\Documents and Settings\All Users\Start Menu\Programs\Games\*"
C:\Documents and Settings\All Users\Start Menu\Programs\Games\*, Are you sure
(Y/N)? y
C:\>rd "C:\Documents and Settings\All Users\Start Menu\Programs\Games"
Access is denied.
C:\>attrib "C:\Documents and Settings\All Users\Start Menu\Programs\Games"
R C:\Documents and Settings\All Users\Start Menu\Programs\Games
C:\>attrib -r "C:\Documents and Settings\All Users\Start Menu\Programs\Games"
C:\>attrib "C:\Documents and Settings\All Users\Start Menu\Programs\Games"
C:\Documents and Settings\All Users\Start Menu\Programs\Games
C:\>rd "C:\Documents and Settings\All Users\Start Menu\Programs\Games"
The directory is not empty.
C:\>dir "C:\Documents and Settings\All Users\Start Menu\Programs\Games"
Volume in drive C has no label.
Volume Serial Number is 6C93-08DC
Directory of C:\Documents and Settings\All Users\Start Menu\Programs\Games
07/07/2004 02:08 PM <DIR> .
07/07/2004 02:08 PM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 37,451,444,224 bytes free
C:\>attrib "C:\Documents and Settings\All Users\Start Menu\Programs\Games\*"
A SH C:\Documents and Settings\All Users\Start
Menu\Programs\Games\desktop.ini
C:\>attrib -h -s "C:\Documents and Settings\All Users\Start
Menu\Programs\Games\*"
C:\>del "C:\Documents and Settings\All Users\Start Menu\Programs\Games\*"
C:\Documents and Settings\All Users\Start Menu\Programs\Games\*, Are you sure
(Y/N)? y
C:\>rd "C:\Documents and Settings\All Users\Start Menu\Programs\Games"
C:\>dir "C:\Documents and Settings\All Users\Start Menu\Programs\Games"
Volume in drive C has no label.
Volume Serial Number is 6C93-08DC
Directory of C:\Documents and Settings\All Users\Start Menu\Programs
File Not Found
C:\>

yippie
 
rmdir /s/q <directory name> will accomplish the same thing without all
the hupla.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top