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?
Asked
Active
Viewed 83 times
-2
-
4"_the un-needed temp files_": is there a subset of files in the `%TEMP%` folder that you want deleted or all of them? – CristiFati Mar 24 '16 at 20:17
-
1how to decide what's un-needed? to delete all files: `del /q "%temp%\*"` – Stephan Mar 24 '16 at 20:18
1 Answers
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