Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING Clearing the temp files from the SCCM

hari

Member
Messages
9
Reaction score
0
Points
1
Greetings Support,

I would like to clear the temp files .cookies,temporary internet files.........

for all the client pcs from the SCCM server.Please share any .exe\batch\powershell script\Vb script to do the same. Please share the steps as well.

Thanks,
Hari.
 
This script might help, however test the script on a test computer once.

Code:
@echo off
cd /d %temp%
for /r %%a in (*.*) do (
del /f /q %~a
) >nul
cd /d "%userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files"
for /r %%b in (*.*) do (
del /f /q %~b
) >nul
cd /d "C:\Windows\Temp"
for /r %%b in (*.*) do (
del /f /q %~b
) >nul
cd /d "C:\Windows\Prefetch"
for /r %%b in (*.*) do (
del /f /q %~b
) >nul

The steps are simple, create a package containing your file, and create a program running it. Remember to distribute it to your distribution point, and from there deploy it to your collection.
 
Back
Top