Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

Windows batch: Generate log file through a cmd command

Hello experts,

I got the following command at: https://pureinfotech.com/delete-files-older-than-days-windows-10/
Very useful to set up directly through windows task scheduler

ForFiles /p "C:\path\to\folder" /s /d -30 /c "cmd /c del @file"

Open in new window


What I want is to enhance it by generating a log file in a specific folder in order to identify folders deleted.
The idea isn't to have a cumulative log file in order to avoid file increase but just to monitor last excution of the command.

If you have questions, please contact me.

Thank you in advance for your help.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Luis Diaz

ASKER

Thank you very much Bill, I will test it and I will keep you inform.