Jump to content

Recommended Posts

Posted
We are running Asus EeePc's with limited storage. To free space is there a batch file or scipt that can be run to remove all hotfix files ($NtUninstall....) hidden in the Windows folder. We are currently having to manually remove these files when updates are applied.
Posted (edited)

Maybe have a script running CCleaner to tidy up the files.

 

I think it has to run in the user context, so would be restricted to a logon script.

 

 

 

See above

Edited by andy_b
too late
Posted

I use this vbs script.

 

Option Explicit
On Error Resume Next
Dim FSO

set FSO=CreateObject("Scripting.FileSystemObject")

FSO.DeleteFolder("C:\Windows\$NtUninstall*")
FSO.DeleteFolder("C:\Windows\$NtServicePackUninstall*")
FSO.DeleteFolder("C:\Windows\$MSI31Uninstall*")
FSO.DeleteFolder("C:\Windows\Temp\**")
FSO.DeleteFile ("C:\Windows\Temp\*")
FSO.DeleteFile ("C:\Windows\*.log")

Set FSO = Nothing

  • Thanks 1
Posted

I believe portable version will run happily from a shared folder.

 

Just out of personal interest, managed to get total size needed down to 556kB, using an older portable version with upx compression and deleting the dll's.

Posted

Deleting temporary files in the local users profiles might be worth a try too. The first batch file is for XP, while the second is for Vista and 7.

 

@echo off
IF "%OS%"=="" GOTO WIN9X
@REM - FIND "DOCUMENTS AND SETTINGS" FOLDER:
SET LOGPATH="C:\Documents and Settings\administrator\Local Settings\Application Data\Microsoft\WINDOWS NT\NTBACKUP\DATA"
%SYSTEMDRIVE%
CD %USERPROFILE%\..
FOR /D %%F IN (*.*) DO DEL /F/S/Q "%%F\LOCAL SETTINGS\TEMP\*.*"
FOR /D %%F IN (*.*) DO DEL /F/S/Q "%%F\LOCAL SETTINGS\TEMPORARY INTERNET FILES\*.*"
DEL /F/S/Q %WINDIR%\TEMP\*.*
DEL /F/S/Q %WINDIR%\*.TMP
DEL /F/S/Q %LOGPATH%\*.LOG

:GOTO END

:WIN9X
REM - WIN9X systems are currently not supported.

:END

 

or

 

@echo off
setlocal
call :Clear_Folder %SystemRoot%\TEMP
pushd C:\Users
for /d %%k in (*) do if exist "%%k\AppData\Local\Temp" call :Clear_Folder "%%k\AppData\Local\Temp"
popd
endlocal
goto :EOF

:Clear_Folder
pushd "%~1"
for /d %%i in (*) do rd /s /q "%%i"
del /f /q *
popd
goto :EOF

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...