Jump to content

[CMD] Deleting Items


Recommended Posts

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?

Link to comment
Share on other sites


This kills ur selected file extension, in this case bmp's in the folder(s)

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 :rolleyes:

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

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...