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

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

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

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

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

Windows 8 Core 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

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

Windows 7 Home Premium x64
 
 

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

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

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

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



Similar help and support threads for2: In need of a script...
Thread Forum
Logon Script Network & Sharing
can't run script 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 05:33 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33