Auto-Eliminate Temp Files for All Domain Users
HTML-код
- Опубликовано: 14 окт 2024
- How to make a policy and implement it for users within the domain. Upon logging in, this policy automatically removes all temporary files for all domain users. In the video, the following command is used:Auto-Expunge Temporary Files for Every Domain User
Observe the guidelines.
@echo off
echo.
echo Deleting Temporary Files...
echo.
:: Delete temporary files from the system %TEMP% folder
rd /s /q %temp%
md %temp%
:: Delete temporary files from the Windows Temp folder
rd /s /q C:\Windows\Temp
md C:\Windows\Temp
:: Clear Internet Explorer/Old Edge temporary files
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
:: Delete Temporary Internet Files (for Windows 10 and other versions)
del /f /s /q "%userprofile%\AppData\Local\Microsoft\Windows\INetCache\*"
del /f /s /q "%userprofile%\AppData\Local\Temp\*"
:: Delete Prefetch files (optional)
rd /s /q C:\Windows\Prefetch
md C:\Windows\Prefetch
echo.
echo All temporary files deleted!
echo.
pause