Subscribe to How-To Geek

Welcome to the How-To Geek Forums

We encourage you to register on our forums and post any questions you might have. The How-To Geeks monitor this forum and will respond to your question quickly.

How-To Geek Forums » Geek Stuff

I cant delete a folder in Dos

(7 posts)
  • Started 1 year ago by quahog
  • Latest reply from quahog
  • Topic Viewed 2347 times

quahog
quahog
Posts: 68

In my Dos prompt, I want to delete a whole folder and all its contents, and I saw on some site that if I use the rd or rmdir commands with the \s attribute it will delete a folder and all its contents, but when I do this, it sais that the folder does not exist and that the folder was not empty. Im messing around with batch files, and I keep running into this problem. Please help.

Thanks

Posted 1 year ago #
Top
 
whs
whs
Posts: 10354

LH, Scott, our new friend seems to still have a few problems with the different Fora. I suggest to move this to "Geek stuff" to give it the proper attention.

Posted 1 year ago #
Top
 
ScottW
ScottW
Posts: 6609

quahog, hey. From the syntax of rmdir, it does look like the /s switch should do the trick:

C:\>rmdir /?
Removes (deletes) a directory.

RMDIR [/Q] [drive:]path
RD [/Q] [drive:]path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S

You can also use the /q switch in batch files. The problems that you are seeing might have something to do with file attributes, such as hidden, system, and read-only. I don't know how rmdir will try to handle those attribs.

Posted 1 year ago #
Top
 
ScottW
ScottW
Posts: 6609

Yes, as I suspected. From the command line reference at TechNet:
http://technet2.microsoft.com/.....x?mfr=true

It can't handle hidden or system files. Last I knew, there was no built-in command to do this, but you can get a small utility that will. I used to use one called treedel, but I don't know what the latest is.

Posted 1 year ago #
Top
 
Scott
Scott
Posts: 4147

Oh and Quahog, you're on double not-so secret probation.
We can leave it at that, or you can protest and be banned yet again.

Posted 1 year ago #
Top
 
quahog
quahog
Posts: 68

Do these commands work with batch files, cause thats what Im using them with, and also, I cant even delete a folder with dumb text files that I just made in it, I dont think theres any hidden, system, or read-only files.

Posted 1 year ago #
Top
 
quahog
quahog
Posts: 68

Thanks for the help, but I figured out that my problem was when I put in the rd command, I was using the \ for the attributes and not the / which is what your supposed to use.

Posted 1 year ago #
Top
 

RSS feed for this topic

Reply

You must log in to post.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
mDNSResponder.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.