polas Posted August 3, 2011 Posted August 3, 2011 Just put it in C:\Documents and Settings\user\Start Menu\Programs\Startupwhen you start up windows it will pop up batch script and remove unusing junk files this is very usefull when you want to be your pc clean in xp cd setup @echo offdel /s /f /q c:\windows\temp\*.*rd /s /q c:\windows\tempmd c:\windows\tempdel /s /f /q C:\WINDOWS\Prefetchdel /s /f /q %temp%\*.*rd /s /q %temp%md %temp%deltree /y c:\windows\tempor~1deltree /y c:\windows\tempdeltree /y c:\windows\tmpdeltree /y c:\windows\ff*.tmpdeltree /y c:\windows\historydeltree /y c:\windows\cookiesdeltree /y c:\windows\recentdeltree /y c:\windows\spool\printersdel c:\WIN386.SWPcls
Yzöwl Posted August 3, 2011 Posted August 3, 2011 My suggestion is to ignore the above script.Not only is it not a good idea to blindly remove things in this manner, it is also a badly written script!
submix8c Posted August 3, 2011 Posted August 3, 2011 (edited) My suggestion is to use CCleaner. You can add the TEMP folder contents as well as the defaults (which work fine).edit - WIN386.SWP on an XP machine? MAGIC!!! Edited August 3, 2011 by submix8c
MagicAndre1981 Posted August 3, 2011 Posted August 3, 2011 My suggestion is to ignore the above script.Not only is it not a good idea to blindly remove things in this manner, it is also a badly written script!Correct.I run cleanmgr.exe from the task scheduler:http://support.microsoft.com/kb/253597/ento delete the files once per week.
allen2 Posted August 3, 2011 Posted August 3, 2011 Also WIN386.SWP is the swap file for win9x and has nothing to do in XP.
CoffeeFiend Posted August 4, 2011 Posted August 4, 2011 I run cleanmgr.exe from the task scheduler:http://support.microsoft.com/kb/253597/ento delete the files once per week.Same here. Works wonders. Set it up once, never have to think about it again (also added a couple custom folders to its list)
Andromeda43 Posted August 8, 2011 Posted August 8, 2011 (edited) The script (batch file) in post one, looks a lot like a takeoff on my own XPCleanup.bat program that I've posted before,and even have on my private web site for download.The clinker in that batch file is that "Deltree.exe" is not a part of Windows XP or any later OS.I guess it was deemed 'too dangerous" by MS and they eliminated it. If used improperly, it can delete an entire HD, with never a whimper.For that batch file to actually work as written, "Deltree.exe" would have to be copied from an older OS like 98 or ME and installed into XP in the C:\Windows\System32 sub directory.It's an 'external' DOS program and will run just fine in XP, but in Vista and Win-7, not so much.On those OS's, instead of Deltree, I use "Echo Y| Del " followed by the path to the files I want deleted, inside quotes.Indiscriminate? A properly written cleanup batch file would only delete things that really should be deleted anyway, like temporary internet files, temp files and other garbage that will build up in the HD forever, or till it fills up and crashes the HD.A little common sense needs to be used with any batch file that can delete files.My own XPCleanup.bat program is pretty generic and safe and I put it in the startup folder for every one of my customers.On my own PC, I get a bit more detailed, including my Firefox cache files and unnecessary files generated by my AV and AS software.I even include the virus vault. CCleaner? It rendered my own HD NON-Bootable, , , twice. I don't want that program anywhere near my PC.Apologies to all yous CC lovers.Both "Easy Cleaner 2" and "AVG Tune-Up" work great and are completely safe.Cheers Mates! B) Edited August 8, 2011 by Andromeda43
Yzöwl Posted August 8, 2011 Posted August 8, 2011 For that batch file to actually work as written, "Deltree.exe" would have to be copied from an older OS like 98 or ME and installed into XP in the C:\Windows\System32 sub directory.It's an 'external' DOS program and will run just fine in XP, but in Vista and Win-7, not so much.On those OS's, instead of Deltree, I use "Echo Y| Del " followed by the path to the files I want deleted, inside quotes.Deltree.exe could actually be located in the same directory as the batch file or any %PATH% location, not necessarily the system32 directory.For many years and several Operating Systems there has been no need to pipe a Y response to a DELete command within a batch file.On Windows 7, I'd suggest you familiarise yourself with powershellRemove-Item <YourPath\*> -Recurse -Force
CoffeeFiend Posted August 9, 2011 Posted August 9, 2011 CCleaner? It rendered my own HD NON-Bootable, , , twice.No oftense, but the first thing that crosses my mind is PEBCAK. Or that you're blaming the crash on it with very little evidence to back it up.I've used it on dozens of machines (using XP Pro, Vista x86, Vista x64 and Win7 x64) for a few years, and I've had exactly zero problems of any kind. We're millions of (happy) CCleaner users and google can't seemingly find any trace of evidence of such a problem either (if it was such a PC crasher, surely there would be lots of angry people). There is no logical reason it would make your machine non-bootable, and you didn't say either what it did to your machine to make it so. Either ways, I wouldn't personally ever go back to using a batch file for this. There's just too many options that are far better (including also ncleaner, fcleaner and several others)I second Yzöwl's recommendation too. While I use CCleaner (scheduled) on desktops, I also use powershell on servers for this (also scheduled to run automatically with the AT command). Like for cleaning up a shared folder which ends up cluttered with temp files. Remove-Item is the "real" command, but you can also use any of its aliases: del, erase, rd, ri, rm, rmdir. For example, our networked copier sends scannned documents in PDF format to a file share. Every night, the script runs and deletes files older than a week:<# Script to delete files older than a week. Scheduled to run every night automatically. Or whatever else comments you want in here.#>$aWeekAgo = (Get-date).AddDays(-7)ls "Z:\Path\to\Somewhere" -r | where-object {$_.lastwritetime –lt $aWeekAgo} | rm(feel free to replace "ls" by either "dir", "gci" or "Get-ChildItem" -- it all works the same but "ls" was only 2 characters)
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now