confOS/windows/ctmpf.bat
Mylloon 2d46d36bc0
Reduce line size
Using tab size of 2 instead of 4 in all scripts
2023-09-13 11:51:35 +02:00

47 lines
1.2 KiB
Batchfile

@ECHO OFF
:: Start as administrator
fltmc >NUL 2>&1 || (
PowerShell Start -Verb RunAs '%0' 2>NUL || (
EXIT 1
)
EXIT 0
)
ECHO CTMPF :: Clean TeMPorary Files
:: Empty the user's temp folder
ECHO Suppression des fichiers dans %TEMP%...
DEL /f /q %LOCALAPPDATA%\Temp\* 2>NUL
RMDIR /s /q "%TEMP%" 2>NUL
:: Empty the system's temp folder
ECHO Suppression des fichiers dans %WINDIR%\Temp...
RMDIR /s /q "%WINDIR%\Temp" 2>NUL
:: Empty the Prefetch folder
ECHO Suppression des fichiers dans %WINDIR%\Prefetch...
RMDIR /s /q "%WINDIR%\Prefetch" 2>NUL
:: Remove old Windows installation
if exist "%SYSTEMDRIVE%\Windows.old" (
ECHO Supprime l'ancienne installation de Windows dans %SYSTEMDRIVE%\Windows.old...
TAKEOWN /f "%SYSTEMDRIVE%\Windows.old" /a /r /d y
ICACLS "%SYSTEMDRIVE%\Windows.old" /grant administrators:F /t
RMDIR /s /q "%SYSTEMDRIVE%\Windows.old"
)
:: Empty useless files of Windows
ECHO Suppression des fichiers dans C:\$WinREAgent...
RMDIR /s /q "C:\$WinREAgent" 2>NUL
ECHO Suppression des fichiers dans C:\Recovery...
RMDIR /s /q "C:\Recovery" 2>NUL
:: Clean disks
ECHO Nettoyage de l'ordinateur avec cleanmgr...
CD %WINDIR%\system32
cleanmgr /AUTOCLEAN
cleanmgr /VERYLOWDISK
EXIT /B