Computing.Net > Forums > Windows XP > BAT file to clear history

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

BAT file to clear history

Reply to Message Icon

Name: maf6373
Date: June 17, 2005 at 22:35:15 Pacific
OS: WINXP PRO
CPU/Ram: P4 1.7GHz, 512MB
Comment:

Does anyone know how to create a batch file that will clear the history folder?



Sponsored Link
Ads by Google

Response Number 1
Name: BuzzStPoint
Date: June 17, 2005 at 22:41:20 Pacific
Reply:

Yes...
I have writtin a tutorial about this If you like follow the tutorial or email me and I'll make the files for you.

You'll need the file called DELTREE.exe
if you can't find it let me know and I'll send it to you.

My tutorial cleans on every boot up or just by calling it by the run menu

Junk Internet Explorer,
Get
Firefox! You'll be happy you did.


0

Response Number 2
Name: BuzzStPoint
Date: June 17, 2005 at 22:43:05 Pacific
Reply:

Sorry bad link..

BuzzStPoint Temp file cleanup.

Junk Internet Explorer,
Get Firefox! You'll be happy you did.



0

Response Number 3
Name: maf6373
Date: June 18, 2005 at 00:45:25 Pacific
Reply:

The script is easy for me to understand, but do I have to make any changes due to the fact that the MY DOCUMENTS folder is located on a different partition than my OS?


0

Response Number 4
Name: XpUser
Date: June 18, 2005 at 06:16:34 Pacific
Reply:

Buzz and I are aware of this issue. You can either wait for Buzz to send you a modified batch file or you open the file into notepad and change the paths accordingly.

i_XpUser


0

Response Number 5
Name: 13526
Date: June 18, 2005 at 06:51:01 Pacific
Reply:

Hi there,
I use Crap Cleaner (ccleaner.exe)
it will do just that and much much more. You can select and deselect what it should clean. The default setting is safe.
It's a free little app and damn fast.

Peter


0

Related Posts

See More



Response Number 6
Name: maf6373
Date: June 18, 2005 at 08:49:52 Pacific
Reply:

XPUser, sure I'll wait for Buzz to send me a link. That would really help. I am new to batch file creation.

Peter, Crap Cleaner looks great, but I want something that will run on system shutdown automatically.

Thanks everyone,

maf6373


0

Response Number 7
Name: trvlr
Date: June 18, 2005 at 10:09:31 Pacific
Reply:

Such routines could be run for dos/'9x. However I don't think you can run it/them (or much else either...?) at shutdown (unlike dos/'9x). At least that was the conclusion some of my colleagues at work reached when considering a similar routine for NT4/W2K a while back.

I posted a query here to re' this idea at the time (a couple of years back?) and the conclusion was similar - it couldn't be done?

Which having said I have a faint recollection of an add-in util that may allow it (for W2K at least - and presumably XP); but in a commercial arena it wasn't considered a viable route (licensing/money etc...).

If it is possible I'd very interested to know how etc.

It can be done at log-on as that's where batch-files are frequently invoked/used?


0

Response Number 8
Name: BuzzStPoint
Date: June 18, 2005 at 10:55:24 Pacific
Reply:

This script can be ran at startup and shutdown before the user logs on or right after the user logs off.

I am aware of the issue of the changing of the profiles and am working on it.. I should have it done this weekend.

If you only changed the "My Documents" folder then you need not to worry. Changing this folder doesn't change the temp file locations.

Junk Internet Explorer,
Get Firefox! You'll be happy you did.


0

Response Number 9
Name: BuzzStPoint
Date: June 18, 2005 at 10:57:03 Pacific
Reply:

the file change is only if you changed the location of the temproary internet files.

However I am changing the batch to include such routines to locate and delete.

Junk Internet Explorer,
Get Firefox! You'll be happy you did.


0

Response Number 10
Name: maf6373
Date: June 18, 2005 at 11:12:30 Pacific
Reply:

Buzz,

I created the BAT file as per the instuctions on your link, but the history folder did not get cleared, nor did the cookies folder. Here is the BAT file that I have created. It clears everything except the history folder. Let me know what you think.

TITLE Disk Cleanup

CLS

C:

CD "C:\Documents and Settings\username\Local Settings\Temp"
DEL /q /s /f *.*

CD "C:\Documents and Settings\username\Local Settings\Temporary Internet Files"
DEL /q /s /f *.*

CD "C:\Documents and Settings\username\Cookies"
DEL /q /s /f *.*

CD "C:\Documents and Settings\username\Local Settings\History"
DEL /q /s /f *.*

EXIT


0

Response Number 11
Name: trvlr
Date: June 18, 2005 at 12:11:34 Pacific
Reply:

"BuzzStPoint"

Thanks for the follow-on to my thoughts...

You say the routine will run at start-up and shutdown. I'm presuming it runs both times automatically? Getting a routine to run at startup (log-on) is OK; it's at shutdown (log-off) where it seemed to be unachieveable in my/our earlier attempt?

I'll await your further details as this routine may yet be one I/we might use (at shutdown/log-off).


0

Response Number 12
Name: BuzzStPoint
Date: June 18, 2005 at 13:15:11 Pacific
Reply:

The DEL command in my book is ineffective. that is why I use the deltree command.. Much stronger tool. You will need to download this file.

I see no sence in clearing on shutdown and start up.

I have mine set to clear on start up.. If you have more that 1 user when you turn on your pc, the files clear just before you logon. The way I expain how to do it, no files are in use so they get deleted.

also your temp files and TIF folder can be quite large.. It's much easier to delete the whole directory as a whole, then 1000 internet files..

I have the code written and is proven to work. I have a pc at work that has 9 users on it.. All temp files are cleared nightly, automatically. If you use my code and alter it I cant say it will work..

As for the people that have changed the location of the the temp files, I am working on the solution and will have it done this weekend.

Junk Internet Explorer,
Get Firefox! You'll be happy you did.


0

Response Number 13
Name: BuzzStPoint
Date: June 18, 2005 at 13:18:47 Pacific
Reply:

maf6373

follow the instructions carefully..

Where the "username" is. You need to change that to your username on your computer. Also like I said above. The DEL command is only good for a few files. Th DELTREE command is stringer and will remove the whole folder.

Junk Internet Explorer,
Get Firefox! You'll be happy you did.


0

Response Number 14
Name: trvlr
Date: June 18, 2005 at 13:26:16 Pacific
Reply:

"Buzz.....":

Yes, clearing it all at log-on is what we accepted; especially as we were unable to get it to work at log-off (it appeared to be a stanrdard/normal no-go for the NT family). Also at log-off "was" the original goal, as it was thought that doing it at log-on would (marginally?) extend log-on time...?

Doing it at log-on is pretty straightforward...?


0

Response Number 15
Name: BuzzStPoint
Date: June 18, 2005 at 21:47:05 Pacific
Reply:

If you are running XP pro you will set this in the gpedit. Follow my instruction.. There you will see the Start up and shut down.

It wont clear the file at "log Off" but on shutdown.

I'm sure there is a way to make them clear at "Log Off" As soon as I finish the batch for the profiles I'll tear deaper in the registry and see if there is a way.

Junk Internet Explorer,
Get Firefox! You'll be happy you did.


0

Response Number 16
Name: trvlr
Date: June 19, 2005 at 06:39:58 Pacific
Reply:

"Buzz...."

Hi again:

If you do manage it at log-off I think it will be widely applauded. We (colleagues et moi) did a lot of research and couldn't find any way to get it work that way. All references indicated scripts/batch-files etc. were (would) run at log-on only...?

The shutdown option is a viable alternative in some (of our) situations. Our requirement was at log-off, as to go thru' a full shutdown and restart was not always viable. The main PCs involved are in a live to-air broadcast environment; and the quick/fast change of users (on-air talent and assorted production staff) at various times demands a minimum log-off/on time (and true shutdown and subsequent reboot obviously takes a little longer)...

Again thanks thus far your info/input.



0

Response Number 17
Name: BuzzStPoint
Date: June 19, 2005 at 10:19:23 Pacific
Reply:

Trvlr

Shoot me an email. Click my name above..

I'll email you when I get a chance and let you know the outcome.

Junk Internet Explorer,
Get Firefox! You'll be happy you did.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: BAT file to clear history

Bat file to run if file is modified www.computing.net/answers/windows-xp/bat-file-to-run-if-file-is-modified/165563.html

modify bat file to delete directory www.computing.net/answers/windows-xp/modify-bat-file-to-delete-directory/167071.html

create bat file to purge log file www.computing.net/answers/windows-xp/create-bat-file-to-purge-log-file/179854.html