batch script: remove file names starting with certain characters
Posted on 2010-08-18
I have a windows batch script which I use to delete certain file names and file sizes from various directories.
I want to add a line in the script that deletes all files starting with certain characters (specificlly "~" and "z") within the directory.
I know some people like to ask why questions so here it is...
I have a game-server and my players use this script to clean up game directories that get filled with trash files from other servers. These files change everything from menus to graphics (bad thing). It just so happens that these server owners start the files with "~" and "z" to make this happen (which is a different subject). So my script would be more efficient if I can target just the files that start with these characters.
Please submit an example script from start to finish, do not assume I can fill in the blanks.
Thanks in advance.