/build/static/layout/Breadcrumb_cap_w.png

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:
Posted by: Channeler 5 years ago
Red Belt
0

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.
@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. 5 years ago
Second Degree Green Belt
0
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.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ