-2

Im trying to make a program that deletes the un-needed temp files with batch. How would I do this in one command? Is it possible?

1 Answers1

0
del "%temp%" /s /f /q

type del /? for help. You won't be able to delete files being used.

Windows deletes files older than 7 days in temp folder automatically. See DiskCleanup task in Task Scheduler.

  • I'm pretty sure Windows does not automatically delete old temp files automatically. I believe you have to schedule the DiskCleanup with the appropriate options. – dbenham Mar 25 '16 at 04:14