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\AppPatch
ECHO.
EXIT
1. 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?
Page 1 of 1
[CMD] Deleting Items
#2
Posted 23 October 2003 - 08:15 AM
This kills ur selected file extension, in this case bmp's in the folder(s)
This kills everything in the folder(s)
and i feeling codie, heres one for visual basic as well
This kills everything in the folder(s)
This kills ur selected file extension, in this case bmp's in the folder(s)
hope i could help you my friend
DEL C:\folder\*.bmp ECHO. EXIT
This kills everything in the folder(s)
DEL C:\folder\*.* ECHO. EXIT
and 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
#3
Posted 23 October 2003 - 10:10 AM
to delete a directory, first you need to delete the contents:
DEL C:\Deleteme\*.*
Then, use the Remove Directory command
RD C:\Deleteme
DEL C:\Deleteme\*.*
Then, use the Remove Directory command
RD C:\Deleteme
#6
Posted 23 October 2003 - 11:01 AM
thx everyone for your help. I am however still having some trouble my code now looks like this:
ECHO
RD /S /Q C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\Accessibility
ECHO.
EXIT
Whats 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.
ECHO
RD /S /Q C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\Accessibility
ECHO.
EXIT
Whats 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.
#7
Posted 30 October 2003 - 06:33 AM
If you have spaces in the path, you have to surround it with quotes:
ECHO RD /S /Q "C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\Accessibility" ECHO. EXIT
- ← [DIASM] MSN messenger 6.0 edit
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- [CMD] Renaming multiple →
Share this topic:
Page 1 of 1



Help
Back to top









