Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 

TheTOM_SK

Batch file to remove files & folders?

Recommended Posts

TheTOM_SK    0

Hi, I have tried to get batch working for months, but nothing was not able to tell, what to do, even Google failed. Then I have found The Avenger and I used that one on XP to remove files, but since I have moved to Vista and that software does not work there, I have the same problem as I had before. I just need to know, how does it work, so I would be able to edit it. If you have any idea, please write it down.

Share this post


Link to post
Share on other sites
TheTOM_SK    0
what are you trying to remove?

I did a clean instal of WinXP about once per week and The Avenger helped me to get rid of files like WMP's network sharing and other junk. An examle from Vista:

C:\Users\...\Favorites\Links
C:\Users\...\Favorites\Microsoft Websites
C:\Windows\Prefetch
C:\Windows\SoftwareDistribution

Edited by TheTOM_SK

Share this post


Link to post
Share on other sites
IcemanND    0

Well for starters deltree does not exist in windows xp or vista.

To delete files from subdirectory trees use del /s names

Deletes one or more files.

DEL [/P][/F] [/Q] [/A[[:]attributes]] names

ERASE [/P] [/F] [/Q] [/A[[:]attributes]] names

names Specifies a list of one or more files or directories.

Wildcards may be used to delete multiple files. If a

directory is specified, all files within the directory

will be deleted.

/P Prompts for confirmation before deleting each file.

/F Force deleting of read-only files.

/S Delete specified files from all subdirectories.

/Q Quiet mode, do not ask if ok to delete on global wildcard

/A Selects files to delete based on attributes

attributes R Read-only files S System files

H Hidden files A Files ready for archiving

- Prefix meaning not

If Command Extensions are enabled DEL and ERASE change as follows:

The display semantics of the /S switch are reversed in that it shows

you only the files that are deleted, not the ones it could not find.

to delete the directory tree and its contents use RD /s path

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

Share this post


Link to post
Share on other sites
TheTOM_SK    0

Thanks for the detail description IcemanND.

I tried various command, but it did not work:

RD [/S] [/Q] C:\New Folder
RD [/S] [/Q] [C:]New Folder
RD [/S] [/Q] [C:\New Folder]
RD [/S] [/Q] [drive:] C:\New Folder

Share this post


Link to post
Share on other sites
TheTOM_SK    0

Thanks, but it does not work. Hmm, I have just read, that bat only marks it as removed, so new files can rewrite it, but it is not actually removed. Or maybe Vista just does not handle bat properly. confused.gif

Share this post


Link to post
Share on other sites
TheTOM_SK    0

I changed bat to cmd and it does not work (screen). :(

I wonder, if there is any freeware software, which can remove folders and files like The Avenger does? I do not care, if it is bat or a software as long as it will do its job.

Edited by TheTOM_SK

Share this post


Link to post
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.

×