caffrey Posted February 26, 2018 Posted February 26, 2018 Don't suppose anyone has a nice script to empty C:\Users\*\AppData\Local\Temp on remote machines recursively ?
ADMaster Posted February 27, 2018 Posted February 27, 2018 run it as a log off script something like rd /s /q %userprofile%\[color=#333333]App[/color][color=#333333]Data\Local\Temp [/color] if you really want to do it remotely perhaps a nested foreach loop of hostnames and c:\users in powershell. What remote admin tools do you have? You can cut the hostnames foreach by deploying the powershell script via SCCM or PDQ. 1
caffrey Posted February 28, 2018 Author Posted February 28, 2018 (edited) Cheers, I ended up with a powershell script Get-ChildItem -Path 'C:\Users' | foreach { Get-ChildItem -Path "$($_.FullName)\AppData\Local\Temp" -ErrorAction Continue | Remove-Item -Force -Recurse } Which works and had to do it per machine, but with the sheer volume of files in there I ended up resorting to using delprof2 to erase profiles and leaving the machines running overnight - I could also use delprof2 remotely Edited February 28, 2018 by caffrey
FishCustard Posted February 28, 2018 Posted February 28, 2018 As written that script won't remove hidden files, as Get-ChildItem only returns hidden files if you pass it the -Force parameter/flag. 1
AJWhite1970 Posted February 28, 2018 Posted February 28, 2018 Mine is an admin script rather than a user script, I run it on a Friday afternoon cd /D C:\Users REM ?-Clean Temp Folder? for /D %%a in (*.*) do DEL /F /S /Q "%%a\AppData\Local\Temp\*.*" 1
caffrey Posted February 28, 2018 Author Posted February 28, 2018 Avid Application Manager ran away with itself, bored today stuck at home so I decided to fix the Music room PC's This was one profiles temp directory.... 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now