January 9, 200521 yr hiany script to delete Temp and Prefetch files and foldes when the system startthanks
January 9, 200521 yr I've shown this before but here again. I can do the pre-fetch but can't find right now...Creates %systemdrive%\XPtemp.cmd and adds the Registry stuff all in 1 fileSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG DELETE %KEY% /fREG ADD %KEY% /V TITLE /D "Deleteting Temp Internet Files, Cookies, History, Pre-Fetch" /fREG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\XPTemps /ve "Cache Killer"REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\XPTemps /v 1 /d "cmd /c \"C:\\XPtemp.cmd\"REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\XPTemps /v 2 /d "cmd /c DEL \"C:\\XPtemp.cmd\"ECHO Title Delete Temp Internet Files, Cookies, History - Please Wait>%systemdrive%\XPtemp.cmdECHO cd %homedrive%%homepath%>>%systemdrive%\XPtemp.cmdECHO rd /s/q Recent>>%systemdrive%\XPtemp.cmdECHO rd /s/q "Local Settings"\"Temporary Internet Files">>%systemdrive%\XPtemp.cmdECHO rd /s/q "Local Settings"\temp>>%systemdrive%\XPtemp.cmdECHO rd /s/q "Local Settings"\cookies>>%systemdrive%\XPtemp.cmdECHO rd /s/q "Local Settings"\history>>%systemdrive%\XPtemp.cmdECHO rd /s/q cookies>>%systemdrive%\XPtemp.cmdECHO rd /s/q temp">>%systemdrive%\XPtemp.cmdECHO rd /s/q history>>%systemdrive%\XPtemp.cmdECHO rd /s/q UserData>>%systemdrive%\XPtemp.cmdECHO md "Local Settings"\"Temporary Internet Files">>%systemdrive%\XPtemp.cmdECHO md "Local Settings"\temp>>%systemdrive%\XPtemp.cmdECHO md "Local Settings"\cookies>>%systemdrive%\XPtemp.cmdECHO md "Local Settings"\history>>%systemdrive%\XPtemp.cmdECHO md Recent>>%systemdrive%\XPtemp.cmdECHO md cookies>>%systemdrive%\XPtemp.cmdECHO md temp>>%systemdrive%\XPtemp.cmdECHO md history>>%systemdrive%\XPtemp.cmdECHO md UserData>>%systemdrive%\XPtemp.cmdREMREM C:\Windows Change to your pathECHO DEL C:\Windows\Prefetch\*.pf>>%systemdrive%\XPtemp.cmdREMECHO EXIT>>%systemdrive%\XPtemp.cmdEXITRun that and reboot. This will do all this probably before you even get logged on unless you have massive Temp stuff. Edited January 10, 200521 yr by maxXPsoft
January 10, 200521 yr Added the reg stuff so its all 1 file. Just click and reboot...On the PrefetchI've tried adding this but instead of adding to the XPTemp.cmd aboveECHO CD %systemroot\Prefetch>>%systemdrive%\XPtemp.cmdECHO for %a in (*.pf) do DEL %a>>%systemdrive%\XPtemp.cmdMaybe someone else can enlighten us on how to add this to %systemdrive%\XPtemp.cmd?Probably be simpler to just add DEL C:\Windows\Prefetch\*.pf but some may have different drive or root.
January 10, 200521 yr There is no need to delete Prefetch during unattended install... This is adequate operation after running xp for few months...
January 10, 200521 yr Author thanks maxXPsofti need this script not for one time i make this XPtemp.cmdcmdow @ /HID@echo offcmdow @ /HID@echo offrd /s/q "%windir%\Prefetch\"rd /s/q "%userprofile%\Local Settings\Temp\"rd /s/q "%windir%\Temp\"rd /s/q "%userprofile%\UserData\"rd /s/q "%userprofile%\Recent\"md "%windir%\Prefetch"md "%userprofile%\Local Settings\Temp"md "%windir%\Temp"md "%userprofile%\UserData"md "%userprofile%\Recent"EXITin registry;Temp Cleaning[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]"Cleaning"="C:\\windows\\system32\\XPtemp.cmd"it is work good thanks
Create an account or sign in to comment