integer Posted October 23, 2003 Share Posted October 23, 2003 I am trying to delete individual folders using a .cmd file I am currently working on. My problem is that I cant delete entire folders. when I use the following code to delete a folder it only deltes the contians found within:DEL C:\WINDOWS\AppPatchECHO.EXIT1. How can I delete entire folders and there contents?2. How can I delete certian extentions found in a folder or a drive .bmp and so on? Link to comment Share on other sites More sharing options...
Doggie Posted October 23, 2003 Share Posted October 23, 2003 This kills ur selected file extension, in this case bmp's in the folder(s)DEL C:\folder\*.bmpECHO.EXITThis kills everything in the folder(s)DEL C:\folder\*.*ECHO.EXITand i feeling codie, heres one for visual basic as well This kills everything in the folder(s)Kill "c:\folder\*.*"This kills ur selected file extension, in this case bmp's in the folder(s)Kill "c:\folder\*.bmp"hope i could help you my friend Link to comment Share on other sites More sharing options...
b0r3d Posted October 23, 2003 Share Posted October 23, 2003 to delete a directory, first you need to delete the contents:DEL C:\Deleteme\*.*Then, use the Remove Directory commandRD C:\Deleteme Link to comment Share on other sites More sharing options...
un4given1 Posted October 23, 2003 Share Posted October 23, 2003 There is a much easier way....rd /s /q c:\folder Link to comment Share on other sites More sharing options...
b0r3d Posted October 23, 2003 Share Posted October 23, 2003 Does the same job Link to comment Share on other sites More sharing options...
integer Posted October 23, 2003 Author Share Posted October 23, 2003 thx everyone for your help. I am however still having some trouble my code now looks like this: ECHORD /S /Q C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\AccessibilityECHO.EXITWhats wrong with my code it doesnt seem to want to run the cmd box closes before I can see an error. I could also use some links to any pdf's that I might use to learn more about this subject. Link to comment Share on other sites More sharing options...
spockboy Posted October 30, 2003 Share Posted October 30, 2003 If you have spaces in the path, you have to surround it with quotes:ECHORD /S /Q "C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\Accessibility"ECHO.EXIT Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now