New
#1
DOS Batch - Forfiles - deleting specific file extensions
Hey all. I've reviewed several different examples of how forfiles works. To set the stage, I need to automatically remove files with a file extension of .0 followed by numbers that increment and these files would be 7 days or older. Unfortunately, none of the examples or forfiles /? usage explains how to specify what I need done to file extensions that end with .0xxxxx
Here is what I have so far:
Within the data directory, there are stats-bin.index files, stats.0XXXXX files and others. The goal here is to only remove those files that begin with stats-bin.<numbers>Code:echo on rem Remove stats-bin.0* files older than 7 days forfiles /p "c:\Program Files\MySQL\MySQL Server 4.1\data" /m stats-bin.0* /c "cmd /c del /Q @file /d -7 rem pause
Currently, this script isn't doing anything. Trying to troubleshoot what I'm doing wrong here. If anyone has another forum they frequent for Windows script-specific help, I'd appreciate it (if this isn't the preferred place to post such a thing).