[SOLVED] How to create a batch script with timer to delete files automatically?.

UncleFelow

Prominent
Jul 30, 2019
37
1
535
For example let's say I have a folder named "X" on my desktop, I want that folder or the files in it to be deleted automatically after 2 hours have passed since I ran the script and I also need a way to cancel it if I don't want the files to be deleted anymore.

Thank you.
 
Solution
A batch file similar to
Code:
Echo This will delete bla bla bla
timeout /T 3600 /nobreak
echo Deleting files from folder bla bla
del c:\users\me\Desktop\foldername /s