WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with MSIE
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

URL monitor

 Keywords:  

Question:

First let me say that I'm a network administrator and on occasion I'm asked by supervisors to tell them where their employees are surfing. As everyone knows, if the persons simply deletes their history, it is very difficult to get any factual info.

Therefore, I would like to write a script that runs in the background when IE6 is running and records the URL of the site being displayed. Any help would be greatly appreciated. The main stumbling blocks I see are making it undetectable to the user, and finding a command that captures the URL.

If you have any thoughts, advice, scripts that I can tweak, please let me know.

Answer:

It may be possible to read the contents of the address bar using the control manager extender. So I guess you could write something that sat hidden and recorded the contents of the address bar at regular intervals.

Another possiblity is to communicate with the WIndows Shell or IE via OLE.

Give this code a try:

oShellApp = ObjectOpen("Shell.Application");
oWindows = oShellApp.Windows()
cnt = oWindows.Count
For x = 0 to cnt-1
   oWin = oWindows.Item(x);
   message('URL',oWin.locationURL)
	ObjectClose(oWin)
Next
ObjectClose(oWindows)
ObjectClose(oShellApp)
exit
Here is some additional code, that logs the information to a file, and runs hidden from the user....

This was developed and tested on Windows XP

;This script will log all of the URLs being 
;viewed by the user, once every hour
IntControl (1002, 0, 0, 0, 0);run hidden
While @True
	now = TimeYmdhms()
	fh = FileOpen("C:\temp\locationlogger.txt","WRITE")
	FileWrite(fh,StrCat("************ ",now, " ************"))
	oShellApp = ObjectOpen("Shell.Application");
	oWindows = oShellApp.Windows()
	cnt = oWindows.Count
	For x = 0 to cnt-1
	   oWin = oWindows.Item(x);
	   FileWrite(fh,oWin.locationURL)
		ObjectClose(oWin)
	Next
	FileClose(fh)
	ObjectClose(oWindows)
	ObjectClose(oShellApp)
	hourfromnow = TimeAdd(now,"0000:00:00:01:00:00")
	TimeWait(hourfromnow)
Endwhile
exit
For more see:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP+OLE~Shell~functions.txt

Article ID:   W15660
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38