Gabe The Nerd Posted July 13, 2005 Share Posted July 13, 2005 Inspired by my cleanup.cmd file on my unattended disk, I set out to make a batch file that I can use for daily cleanup: emptying the recyle bin, deleting temporary internet and temp files, etc. I was wondering about a few things, like how can I delete the entire contents of a folder but not the folder itself? And how do I know when to use the "DEL" command and when to use the "RD /S /Q"? Any other tips like how to overwrite the files (making them unreadable) or anything like that would be welcome. I'm sure there are freeware programs that do just this and look better doing so, but it'd be cool to write it myself (with your help of course). Thanks. Link to comment Share on other sites More sharing options...
aspenjim Posted July 13, 2005 Share Posted July 13, 2005 (edited) I use a ramdisk from (QSOFT) and have a reg file that defaults the temp, internet cache and cookies to the ramdrive. Then everytime it powers off, you have a clean pc, including the index.dat files. You need 1+ gig of ram though. The only time it is a problem is when a internet d/l is over the amount of ram you specify for the ram drive. When I know I have a bigger download, I disable it temporarily. It's works pretty slick for me.aj Edited July 13, 2005 by aspenjim Link to comment Share on other sites More sharing options...
MHz Posted July 13, 2005 Share Posted July 13, 2005 You could just use TaskManager and Cleanupmgr.exe?Automate Disk Cleanup Cleanmgr.exe is designed to clear unnecessary files from your computer's hard disk. You can use command-line options to specify that Cleanmgr.exe cleans up certain files. You can then schedule the task to run at a specific time by using the Scheduled Tasks tool.To start the Disk Cleanup tool, either run the Cleanmgr.exe command, or click Start, point to Programs, point to Accessories, point to System Tools, and then click Disk Cleanup. Disk Cleanup supports the following command-line options: /d driveletter: - This option specifies the drive that you want Disk Cleanup to clean. /sageset: n - This option displays the Disk Cleanup Settings dialog box and also creates a registry key to store the settings that you select. The n value, which is stored in the registry, allows you to specify tasks for Disk Cleanup to run. The n value can be any integer value from 0 to 65535. To have all of the options available when you use the /sageset option, you might need to specify the drive where Windows is installed. /sagerun: n - This option runs the specified tasks that are assigned to the n value if you use the \sageset option.For example, in Scheduled Tasks, you could run the following command after you run the cleanmgr /sageset:11 command: cleanmgr /sagerun:11This command runs Disk Cleanup and includes the options that you specified with the cleanmgr /sageset:11 command.Why look anywhere else? Link to comment Share on other sites More sharing options...
gunsmokingman Posted July 13, 2005 Share Posted July 13, 2005 Here a VBS script That runs the clean up.CreateObject("Wscript.shell").run ("cleanmgr /sagerun:99"),1 , True CreateObject("Wscript.shell").popup "Completed The Clean Up", 3 , "Clean Mgr", 0 + 32 Link to comment Share on other sites More sharing options...
diesel_98a Posted July 13, 2005 Share Posted July 13, 2005 when running the vbs script, do items need to be selected on the 1st run or does that not matter, cause i know that when running the sagerun:99 from the run box the items need to be selected........... Link to comment Share on other sites More sharing options...
gunsmokingman Posted July 14, 2005 Share Posted July 14, 2005 I wrote that and after reading this post and i did not get running the sagerun:99 from the run box the items need to be selected...........It Just ran the script, with no selection box Link to comment Share on other sites More sharing options...
suryad Posted July 14, 2005 Share Posted July 14, 2005 CCleaner and System mechanic pro...once a week or once every 2 weeks and your comp will stay as good as new. Link to comment Share on other sites More sharing options...
MHz Posted July 14, 2005 Share Posted July 14, 2005 I wrote that and after reading this post and i did not get running the sagerun:99 from the run box the items need to be selected...........It Just ran the script, with no selection box<{POST_SNAPBACK}>You did not set the cleanmgr into registry.Ay first you need to record the settings to registry.cleanmgr.exe /dc /sageset:1This is saved setting number 1, by using the /sageset: parameter. /d is the chosen drive letter, c in this case.When run, a window will open with checkboxes for each area to cleanup.When user selected are checked, and ok is pressed, then it is recorded in registry.Then you just need to set this command, to run from Task Manager.cleanmgr /sagerun:1That will run it at the set time by Taskmanager.Automatic junk cleanup. No need for an extra program, as it would be more unneeded junk to the harddrive. Link to comment Share on other sites More sharing options...
wizy Posted July 14, 2005 Share Posted July 14, 2005 CCleaner supports command line parameters. You can then use the task scheduler from the control panel to set it up to run every night and do all the cleanup you need. Link to comment Share on other sites More sharing options...
diesel_98a Posted July 14, 2005 Share Posted July 14, 2005 gunsmokingman, run the cleanmgr.exe sagerun:99 from the run box, start --> run, it should popup w/ the diskcleanup wanting u to select the items to be cleaned, but it sounds like it will run w/out prompting using the vbs script.......... Link to comment Share on other sites More sharing options...
suryad Posted July 14, 2005 Share Posted July 14, 2005 CCleaner supports command line parameters. You can then use the task scheduler from the control panel to set it up to run every night and do all the cleanup you need.<{POST_SNAPBACK}>Thanks I didnt know that. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now