• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 584
  • Last Modified:

System temp files

Hi

i have tried lots of batch files which is available in internet for deleting the temp, temporary internet files and history in local settings for a user profile. but nothing worked. Please help me wwith a batch file which can delete all the data's at one shot.

Regards,
Sureshkumar
0
Sureshkumaar
Asked:
Sureshkumaar
  • 4
1 Solution
 
Sikhumbuzo NtsadaSenior IT TechnicianCommented:
Some of the data may not be deleted as it is being used by other programs at time you are trying to delete.

Try "OETool" for Outlook, it will clear the temp folder only though.
0
 
ReneGeCommented:
Two options:
1- http://ss64.com/nt/cleanmgr.html
2-Play arround with this batch file that contains a collection of command lines to delete stuffs.

@echo off

::cleanup.cmd

:: This script will delete files from the current user profile
:: Use at your own risk!


:: Select system drive
CD /d C:\



:: DELETE INTERNET EXPLORER 7,8 AND MAYBE UP CASHED FILES
:: ***************************************

::Delete All
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

::Delete All – “Also delete files and settings stored by add-ons”
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

:: Temporary Internet Files
echo Temporary Internet Files
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

::Cookies
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

::History
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1


::Form Data
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16

::Passwords
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

:: ***************************************

echo thumbs.db
CALL :s_clean "C:\thumbs.db"
echo *.bak
CALL :s_clean  "C:\*.bak"
echo *.tmp
CALL :s_clean  "C:\*.tmp"
echo *.temp
CALL :s_clean  "C:\*.temp"
echo ~*.*
CALL :s_clean  "C:\~*.*"

REM  "%USERPROFILE%\Application Data\Microsoft\Office\Recent\*.*"
CALL :s_clean  "%USERPROFILE%\Application Data\Microsoft\Office\Recent"

RMDIR /q /s "%USERPROFILE%\Application Data\Microsoft\Office\Recent"
MD "%USERPROFILE%\Application Data\Microsoft\Office\Recent"

REM  "%USERPROFILE%\Application Data\Microsoft\Access\ACWZUSR.MDT"
CALL :s_clean  "%USERPROFILE%\Application Data\Microsoft\Access\ACWZUSR*.MDT"

:: Delete Local User Temp Files
RMDIR /q /s "%USERPROFILE%\Local Settings\Temp"
MD "%USERPROFILE%\Local Settings\Temp"

:: Delete Prefetch files
RMDIR /q /s "C:\WINDOWS\Prefetch"
MD "C:\WINDOWS\Prefetch"

goto :eof

:s_clean
attrib +a -s -h -r %1 /s 2>nul 1>&2
del /s /f %1 2>nul 1>&2
goto :eof

Open in new window

0
 
ReneGeCommented:
Glad I could help
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
ReneGeCommented:
Would you mind sharing your command line selection finnal batch file?

Cheers,
Rene
0
 
SureshkumaarAuthor Commented:
Hi renege,

Thanks for your help. One small issue i noticed, after running the batch file i am unable to open any office products. it stating to install the configurations which takes 2 hours of time. and after ~*.* the file is not getting executed. Please help me on this. Thanks in advance.
Suresh
0
 
ReneGeCommented:
The batch file suggested is a collection of "cleaning" command line you must choose depending on what you need.

Having sed that, would you mind sharing with us your finnal batch file?

Cheers,
Rene
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now