Batch file to remove files & folders? If it only was as easy as reg files are.
Posted 12 December 2006 - 07:16 AM
Posted 12 December 2006 - 08:28 AM
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
This post has been edited by TheTOM_SK: 12 December 2006 - 08:28 AM
Posted 15 December 2006 - 02:36 AM
DELTREE C:\NewFolder DR
I would never try to use bat, but removing files one by one take houres.
This post has been edited by TheTOM_SK: 15 December 2006 - 02:36 AM
Posted 15 December 2006 - 07:20 AM
To delete files from subdirectory trees use del /s names
DEL [/P][/F] [/S] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F] [/S] [/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
RMDIR [/S][/Q] [drive:]path
RD [/S] [/Q] [drive:]path
/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
/Q Quiet mode, do not ask if ok to remove a directory tree with /S
Posted 15 December 2006 - 12:51 PM