2
votes
1answer
38 views

How do I delete symlinks from a Windows folder with a batch file/script?

How do I delete all symlinks and only all symlinks from a folder with a batch file/script? The folder is c:\wamp\www, and this is what I've tried: Content files delete.cmd for /f "delims=" %%D in ...
0
votes
1answer
305 views

How to create batch file that delete files by words at the end of file name (using a list of words)?

I have a directory with thousands of html files scattered across several subdirectories. I need to delete all files matching any one of many criteria. All criteria are similar by kind. The file names ...
0
votes
2answers
1k views

Batch command to delete files from file list [duplicate]

This code works fine. it deletes files from a file list: For /f %%a in (file.lst) do del %%a But why is the below one not working? It deletes the .lst file itself: if exist file.lst ( set ...
2
votes
3answers
1k views

Delete set of files using find command

Background Delete a set of files, scattered across different directories. Problem The following code does not work (the unescaped | causes issues); for %i in (dir /s/b | find "lock") do echo del ...
3
votes
1answer
267 views

Delete files from one folder if a similarly named file does not exist in another folder

I need to delete files from folder A if a file with the same name but different file type does not exist in folder B. For example: FOLDER A file1.gif file2.gif file3.gif file4.gif file5.gif ...
0
votes
1answer
163 views

Delete folders with a common string but with spaces in folder names

I have a bunch of folders, some with spaces in their folder names and some not. They all have a certain string common in their folder names and they all lie inside a single directory. For e.g new ...
3
votes
1answer
658 views

Windows Batch recursive delete old files

I'm looking for a function in batch that recursive delets all files/folders older than X Days from a given path. Is there a Fast and easy snippet that could be placed in a batch function?
2
votes
3answers
2k views

Make a batch file find duplicate file names with different extensions, and actions on the results

What I want to do is have a batch file search folders, and subfolders, for matching file names that are ending in .mp3 and .wma and delete or move the *.wma duplicates. Below you'll find what I have ...
2
votes
2answers
4k views

Batch delete : Access is denied

As the title suggests, I'm having issues with the del command in a batch file. When it gets to the delete step I get the message "Access is denied". My batch command looks something like this. set ...
3
votes
2answers
3k views

Delete duplicate files with Windows batch file

I have a program that automatically copies files to a directory, and if it creates a duplicate it will name it like so: file with duplicate.xxx file with duplicate - 1.xxx file with duplicate - 2.xxx ...
1
vote
2answers
2k views

How to copy directory structure, by only two levels but not the third?

From XP's Command Prompt, I am using XCOPY to copy directory structure of s:\bloo\"[8family]\"[30-40genus]\"[5species]\ and want to limit the structure to just the genus and families, and ignore the ...
1
vote
3answers
267 views

How to Delete a file at a specified date

I want to delete a file (a .exe) from a folder, after a specified date, say 25/Feb/2010. How can I use scheduled tasks and batch files for this. I am not sure whether the code below work : @ECHO OFF ...
0
votes
1answer
259 views

Delete Protected WMA

I have several hundred protected WMA files that I don't want to keep, spread in a several level deep folder structure. Is there an easy way to detect these files and delete them? There are also ...