Jump to content

Script to Delete Certian Files in Certain locations.


Recommended Posts

I have a customer asking to have MP3 and MP4 files removed from their server and I have a recursive script that works fine, but they want it to do the following:

Search for MP3 and MP4 files on the server, but only on fixed drives, no network connections.

Delete all the files it sees except from folders they say it's ok to have the files:

Keep contents: folder name, folder name, folder name

Delete contents :All other folders

There is a bunch of other crap, but I think I can solve those from some of your examples and other AutoIT scripts I have if I can get this to work. I just need a solid starting point.

Thank You in Advance.

Link to comment
Share on other sites

not too hard, but let's start with what we have: care to post the script you are already using? it's easier so we can see to modify it, rather then write it from scratch.

also, if you are interested in only local files on NTFS volumes, you can read the MFT directly instead of reading the filesystem recursively - it's much faster, you can search the forum for some examples.

and of course, there are programs that already do just that. one ready-made implementation was written by KaFu at:

http://funk.eu/smf/

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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
 Share

  • Recently Browsing   0 members

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