Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: In need of a script...

12 Oct 2010   #1
Gornot

Windows 7 Home Premium x64
 
 
In need of a script...

I am looking for a script which can delete cookies, Windows + browser cache automatically on a regular (scheduled) basis. Can this be done through Windows itself or would i have to implement a custom script or something?

I am looking to replace CCleaner and similar software package(s). Just now I troubleshooted my sister's PC with an expert who said that stuff like Ccleaner is nothing but trouble. He removed the garbage files manually through Total Commander (ugh), but honestly I can't be bothered to barge into my sis' room every couple of days and ravage through AppData folders to remove temp data and cookies.


My System SpecsSystem Spec
.
12 Oct 2010   #2
mickey megabyte

ultimate 64 sp1
 
 

have you tried windows disk cleanup?

just type cleanup into the start-menu search-box.

*edit* sorry, re-reading your post it seems you want to automate it.

you can use task-scheduler to (wait-for-it) schedule tasks, but i don't know how to automate the cleanup options...read this tutorial - it's for an annual (!) cleanup, but can be easily modified.
My System SpecsSystem Spec
12 Oct 2010   #3
Gornot

Windows 7 Home Premium x64
 
 

Ah, I see now xD
Thanks, will try it, hope it works.
In the meantime, I'd like to hear more suggestions and/or confirmation of efficiency by using this kind of process instead of stuff like Ccleaner (and similar).
My System SpecsSystem Spec
.

12 Oct 2010   #4
Hopalong X

Windows7 Pro 64bit SP-1; Windows XP Pro 32bit
 
 

+1 For Windows disk Clean Up.

It doesn't do any damage and safetly cleans out everything.

The scheduler appears to run as Administrator so it should be thorough.

Weekly looks good or sooner if wanted. Or on start up though it may slow start up a bit.

My 2 pennies.
Mike
My System SpecsSystem Spec
12 Oct 2010   #5
Ztruker

Windows 10 Pro X64
 
 

You can schedule CCleaner to run automatically once you've set it up the way you want. Not what you asked but thought I'd throw it out here anyway. CCleaner accepts command line parameters. See here:

Piriform - Command-line parameters

eg:

CCleaner.exe /AUTO CCleaner runs silently and automatically, using the current set of saved options to clean the PC. CCleaner then exits.

CCleaner.exe /AUTO /SHUTDOWN CCleaner runs silently and automatically, using the current set of saved options to clean the PC. Windows then shuts down automatically..

Note: You cannot run /SHUTDOWN by itself. It must be preceded by /AUTO.
My System SpecsSystem Spec
12 Oct 2010   #6
Lemur

Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
 
 

Mickey's solution was great. If you wanted to create a batch file ...


DEL /S/F/Q "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
DEL /S/F/Q "%USERPROFILE%\Cookies"
DEL /S/F/Q "%USERPROFILE%\Recent"
DEL /S/F/Q "%USERPROFILE%\Local Settings\History"
endif
My System SpecsSystem Spec
12 Oct 2010   #7
Gornot

Windows 7 Home Premium x64
 
 

Thanks, Lemur
My System SpecsSystem Spec
12 Oct 2010   #8
WindowsStar

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

Quote   Quote: Originally Posted by Lemur View Post
Mickey's solution was great. If you wanted to create a batch file ...


DEL /S/F/Q "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
DEL /S/F/Q "%USERPROFILE%\Cookies"
DEL /S/F/Q "%USERPROFILE%\Recent"
DEL /S/F/Q "%USERPROFILE%\Local Settings\History"
endif
Lemur, respectfully there are several problems with this script.

1) Most of those files do not exist in those places. They are junction points to the real place the files are stored. So if you look in "%USERPROFILE%\Recent" from the Command Prompt you will see that is it empty. You really need to go to:

"%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent"

2) Plus you don't want to delete the desktop.ini files in those folders. Not that it will destroy anything but it will remove the pretty icons and the way the folder functions when you look at them in Windows Explorer. -WS
My System SpecsSystem Spec
13 Oct 2010   #9
Gornot

Windows 7 Home Premium x64
 
 

Thanks for the input, WS, I set up the cleanup utility and scheduled it to run every few days, so it's good
My System SpecsSystem Spec
13 Oct 2010   #10
Lemur

Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
 
 

Quote   Quote: Originally Posted by WindowsStar View Post
Quote   Quote: Originally Posted by Lemur View Post
Mickey's solution was great. If you wanted to create a batch file ...


DEL /S/F/Q "%USERPROFILE%\Local Settings\Temporary Internet Files\*.*"
DEL /S/F/Q "%USERPROFILE%\Cookies"
DEL /S/F/Q "%USERPROFILE%\Recent"
DEL /S/F/Q "%USERPROFILE%\Local Settings\History"
endif
Lemur, respectfully there are several problems with this script.

1) Most of those files do not exist in those places. They are junction points to the real place the files are stored. So if you look in "%USERPROFILE%\Recent" from the Command Prompt you will see that is it empty. You really need to go to:

"%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent"

2) Plus you don't want to delete the desktop.ini files in those folders. Not that it will destroy anything but it will remove the pretty icons and the way the folder functions when you look at them in Windows Explorer. -WS
YIKES! My bad. Old script. Sorry
My System SpecsSystem Spec
Reply

 In need of a script...




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Dos script help
Hi, Below is my folder path, D:/Sample I have .sql files in that folder and i need to get the file names based on modified/created date i pass. for ex : i need to get the file names created/modified on or after 10/01/2014(mm/dd/yyyy). Can any please give me some sample script to make this...
General Discussion
What is Macro / Script ?
I heard a lot about Macro and Scripts , something about automating task, file management, directory management, disk drive management etc. So how can any user use that to his efficiency, like file and directory management is one thing i could associate with the prospect of learning Macro or...
General Discussion
Logon Script
I like to create small websites, just doing fun stuff with HTML and such. I thought it'd be easier to share the htdocs folder(I'm using XAMPP - that's where are all HTML etc files are) and edit those files / create new files from any comp in my network. So... I wanted to run a script (net use...
Network & Sharing
ie8 script error
had a bit of trouble with ie8 tried reinstalling ie8 for msn and another or epeadia all the same problem loads of script errors I have done a reg scan and clean unticked the debugging in tools advanced anything else i can do thanks
Browsers & Mail
Need help testing my script
Hi. I didn't know where to put this thread. I felt this was the best place. I have spent all day on creating a .bat script that replaces explorer.exe with my modified explorer.exe (only change is the Start Orb .bmp file.) I would be very happy if someone could test it and see if it actually...
Customization
can't run script
Having a problem run this script at 1am /every:Friday c:\windows\shutdown.exe /l when I run it a black screen pop up and then disappears so I know the script is running but nothing is happen. I have ran it from the command line and it say access denial but I am in the local administrator...
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:44.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App