First, Did a quick search and found something that might do what you want, but would be very careful to make sure it works correctly. Don't have a windows machine handy so can't test it at moment.
Found this, but it is to delete all files older than 30 days in the path, so that would not be what one wants.
ForFiles /p "C:\My Folder" /s /d -30 /c "cmd /c del @file"
Another page gave more info on forfiles and has a search mask that I believe would allow one to limit which files.
forfiles [/P pathname] [/M searchmask] [/S] [/C command] [/D [+ | -] [{<date> | <days>}]]
So, if one wanted to delete all the LNK*.PNL files older than 30 days
forfiles /p "C:\PMAIL\MAIL" /M LNK*.PNL /S /D -30 /c "cmd /c del @file"
In the above command it would be processing the Base Directory and all subdirectories because of the /S. If just want to do a specific user Mail directory change path to "C:\PMAIL\MAIL\user" and drop the /S.
The /M is described as:
/M <searchmask> Searches files according to the specified search mask. The default searchmask is *
But would copy the LNK*.PNL files to another directory, and also put some other files in directory. Copying to retain the date otherwise they would not be older than 30 days. Put some files not meeting the mask to make sure it doesn't delete them if older than 30 days.
wine and dosbox-x don't seem to support the forfiles option, so could test it.
On liinux the command would be like this.
find /path/to/ -type f -mtime +30 -name '*.gz' -execdir rm -- '{}' \;
For my directory with full path
find /home/msetzerii/.wine/drive_c/PMAIL/MAIL/ -type f -mtime +30 -name 'LNK*.PNL' -execdir rm -- '{}' \;
First, Did a quick search and found something that might do what you want, but would be very careful to make sure it works correctly. Don't have a windows machine handy so can't test it at moment.
Found this, but it is to delete all files older than 30 days in the path, so that would not be what one wants.
ForFiles /p "C:\My Folder" /s /d -30 /c "cmd /c del @file"
Another page gave more info on forfiles and has a search mask that I believe would allow one to limit which files.
forfiles [/P pathname] [/M searchmask] [/S] [/C command] [/D [+ | -] [{<date> | <days>}]]
So, if one wanted to delete all the LNK*.PNL files older than 30 days
forfiles /p "C:\PMAIL\MAIL" /M LNK*.PNL /S /D -30 /c "cmd /c del @file"
In the above command it would be processing the Base Directory and all subdirectories because of the /S. If just want to do a specific user Mail directory change path to "C:\PMAIL\MAIL\user" and drop the /S.
The /M is described as:
/M <searchmask> Searches files according to the specified search mask. The default searchmask is *
But would copy the LNK*.PNL files to another directory, and also put some other files in directory. Copying to retain the date otherwise they would not be older than 30 days. Put some files not meeting the mask to make sure it doesn't delete them if older than 30 days.
wine and dosbox-x don't seem to support the forfiles option, so could test it.
On liinux the command would be like this.
find /path/to/ -type f -mtime +30 -name '*.gz' -execdir rm -- '{}' \;
For my directory with full path
find /home/msetzerii/.wine/drive_c/PMAIL/MAIL/ -type f -mtime +30 -name 'LNK*.PNL' -execdir rm -- '{}' \;