Delete AppData Temp files
Hello,
I'm looking to create a batch that would clean the AppData Local Temp folder on all user profiles at a specific time.
Would this be the proper command for it to start off?
DEL C:\%Users%\AppData\Local\Temp
0 Comments
[ + ] Show comments
Answers (2)
Answer Summary:
Please log in to answer
Posted by:
Channeler
6 years ago
Top Answer
I would do it this way, with a BAT file, Just change the path, the %USERNAME%, should grab all users.
The variable TargetDir will contain whatever path you specify.
rd deletes a directory. This command is the same as the rmdir command.
/s deletes a directory tree (the specified directory and all its sub-directories, including all files)
/q Specifies quiet mode. Does not prompt for confirmation when deleting a directory tree.
The variable TargetDir will contain whatever path you specify.
rd deletes a directory. This command is the same as the rmdir command.
/s deletes a directory tree (the specified directory and all its sub-directories, including all files)
/q Specifies quiet mode. Does not prompt for confirmation when deleting a directory tree.
@echo off
set TargetDir=C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data
rd /s /q "%TargetDir%"
Save that as a BAT file, and you can use it with any tool such as SCCM or KACE.
Posted by:
five.
6 years ago
I have used this ahk script ages ago and it worked fine for me. The problem is the fact that you are wanting to cleanup every user on the machine. You will have to first gather a master list. The script would need be updated to be modernized, take out the XP centric stuff. Well it wouldn't format the code correctly for some reason, so I removed it.