PDA

View Full Version : NewBie: how to clear user/history/today


discosux
05-04-2001, 01:28 PM
I want to automate the following action: go to the History file of the current user, open it, right-click on 'Today' and choose 'Delete'. I am only interested in the URL's that Internet Explorer 5 uses, so other options that destroy todays IE history are welcome too. Or even better would be an option that forces IE not to write to the history file for some time.
I know that Windows scripting exist for five minutes now, and that's all I know, so please keep an answer simple...
Thanks in advance,
Diederik

RWSchlatter
05-04-2001, 02:57 PM
Scripting is not really designed to interact with the GUI.
You could try to start an application (eg IE) and then use the SendKeys method (look up in the Help file). Or if you know how the work with the Registry, you could try to force the IE settings for the next application launch there. Try the first approach.

______________
Regards - Richard

spragers
05-07-2001, 04:52 PM
This was my first "SendKeys" project from last week, just getting started with scripting etc.

This only works for one profile (I'm using it for card catalog computers in a library setting - all use same username etc.) - it could work for others but you would have to manually change the settings.

'automate Explorer to delete today's history contents


WshShell.Run "explorer"
WScript.Sleep 2000
WshShell.AppActivate "Exploring"
WScript.Sleep 2000
'depends in which frame the focus begins
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{LEFT}"
WScript.Sleep 100
WshShell.SendKeys "{LEFT}"
WScript.Sleep 100
WshShell.SendKeys "{LEFT}"
WScript.Sleep 100
WshShell.SendKeys "{LEFT}"
WScript.Sleep 100
WshShell.SendKeys "{LEFT}"
WScript.Sleep 100
WshShell.SendKeys "{LEFT}"
WScript.Sleep 100
WshShell.SendKeys "{LEFT}"
WScript.Sleep 500
WshShell.SendKeys "{RIGHT}"
WScript.Sleep 500
'My Computer
WshShell.SendKeys "m"
WScript.Sleep 500
WshShell.SendKeys "{RIGHT}"
WScript.Sleep 500
'assumes first entry is A: second is C:
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "winnt"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 1000
WshShell.SendKeys "prof"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 1000
'rplace XXXX with first few letters of username
WshShell.SendKeys "XXXX"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 1000
WshShell.SendKeys "his"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 1000
WshShell.SendKeys "{DOWN}"
WScript.Sleep 500
WshShell.SendKeys "~"
WScript.Sleep 1000
WshShell.SendKeys "{END}"
WScript.Sleep 500
WshShell.SendKeys "+{HOME}"
WScript.Sleep 500
WshShell.SendKeys "{DEL}"
WScript.Sleep 1000
WshShell.SendKeys "y"
WScript.Sleep 500
WshShell.SendKeys "%{F4}"

This works by itself, but I want to include it in a startup batch program that also handles printer assignments, file updates, etc.

In other words I'm going to try TweakUI now :o)

discosux
05-09-2001, 02:55 PM
Mmmm, I think this is not what I am looking for.... Thanks anyway.

Go*.*
05-10-2001, 01:32 AM
Here is a different approach works best with IE5
http://users.aol.com/axcel216/newtip12.htm#CACHRAM

Wraith
05-11-2001, 04:37 PM
Try writing a script which just deletes the contents of "C:\windows\history" or "C:\windows\history\today"