+ Post New Thread
Results 1 to 13 of 13
Scripts Thread, inet.vbs logging internet use in Coding and Web Development; Hey guys have been trying to find a way to monitor internet use (website visited) came across this .vbs on ...
  1. #1
    neon's Avatar
    Join Date
    Apr 2009
    Location
    Market Harborough
    Posts
    222
    Thank Post
    7
    Thanked 22 Times in 20 Posts
    Rep Power
    15

    inet.vbs logging internet use

    Hey guys have been trying to find a way to monitor internet use (website visited) came across this .vbs on edugeek and thought it looked just what I needed, I cant seem to get it work though I have looked over the script and cant see any errors, would anybody mind casting their eye on it?

    I have created a hidden network share called \monitor$ trying to get the .htm file into here if possible
    Attached Files Attached Files

  2. #2


    Join Date
    Jul 2007
    Location
    Rural heck
    Posts
    2,662
    Thank Post
    120
    Thanked 433 Times in 352 Posts
    Rep Power
    126
    spyPath = "\\server\monitor$" &strUsername&"\spy.htm"

    Should be

    spyPath = "\\server\monitor$\" &strUsername&"\spy.htm"

  3. #3
    neon's Avatar
    Join Date
    Apr 2009
    Location
    Market Harborough
    Posts
    222
    Thank Post
    7
    Thanked 22 Times in 20 Posts
    Rep Power
    15
    Have changed it, now I get a folder made in my network share called inetAdministrator with nothing in it?
    I tried deleteing the folder and running the script but get an error on line:161 char:4 error: path not found

  4. #4
    Cools's Avatar
    Join Date
    Jan 2009
    Location
    Bedfordshire
    Posts
    498
    Thank Post
    24
    Thanked 62 Times in 57 Posts
    Rep Power
    25
    Problem with line 160 chr 9

    oFS.CreateFolder(("\\server01\spy$\inet" & strUserName))

    can any one help ??

  5. #5

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    65
    Same issue - you're missing a backslash and creating a file path of inetUsername instead of a folder inet with a subfile of username.htm

  6. #6

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,897
    Thank Post
    3,420
    Thanked 1,081 Times in 997 Posts
    Rep Power
    369
    Quote Originally Posted by Cools View Post
    Problem with line 160 chr 9

    oFS.CreateFolder(("\\server01\spy$\inet" & strUserName))

    can any one help ??
    Code:
    strUserName = objNet.UserName
    spyPath = "\\server\monitor$" & strUsername & "\spy.htm"
    in the path you have used the variable strUsername where as the variable you have done is StrUserName

    Also I have found in your code that when you are using the ampersands ie & you are not putting spaces between the quote marks etc ie

    "String here"&variable&"String"

    Not sure if that works or not but I normally just to make it easier to read put a space in the example below I have put under scores to represent a space so a _ is a space.

    "String goes here"_&_Variable_&_"Another string"

    The other thing I would do just for a test purpose to make sure that the FSO can use unc paths and it works with ref to that is to just make a small sample vbs that can create a text file on the unc path and if that works then go from there.

  7. #7
    neon's Avatar
    Join Date
    Apr 2009
    Location
    Market Harborough
    Posts
    222
    Thank Post
    7
    Thanked 22 Times in 20 Posts
    Rep Power
    15
    Cheers guys, seem to be getting somewhere the .htm file now appears and I can open it open however there is no websites in the links...?
    Attached Images Attached Images

  8. #8

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,897
    Thank Post
    3,420
    Thanked 1,081 Times in 997 Posts
    Rep Power
    369
    Quote Originally Posted by neon View Post
    Cheers guys, seem to be getting somewhere the .htm file now appears and I can open it open however there is no websites in the links...?
    might be wrong but looks like you commented out your write line command

    'oTextStream.WriteLine

    Code:
    
    ' +----------------------------------------------------------------------------+
    ' | Find Links within Index.dat                                                |
    ' +----------------------------------------------------------------------------+
    Sub FindLinks(strMatchPattern, strPhrase, file)
    Dim oRE, oMatches, oMatch, dt, start, sArray, timeStamp, url 
    
        Set oRE = New RegExp
        oRE.Pattern = strMatchPattern
        oRE.Global = True
        oRE.IgnoreCase = False
        Set oMatches = oRE.Execute(strPhrase)
        For Each oMatch In oMatches
          start = Instr(oMatch.FirstIndex + 1,strPhrase,": ")
          If start <> 0 Then
            sArray = Split(Mid(strPhrase,start+2),"@")
            url=Left(sArray(1),InStr(sArray(1),chr(0)))
            dt=AsciiToHex(Mid(strPhrase,oMatch.FirstIndex+1+16,8))
            timeStamp = cvtDate(dt(7)&dt(6)&dt(5)&dt(4),dt(3)&dt(2)&dt(1)&dt(0))
            'oTextStream.WriteLine "<nobr>" & sArray(0) & " - " & timeStamp & " - " & "<a href="&url&">"&url&"</a> - " & file & " - " & CStr(oMatch.FirstIndex + 1) & "</nobr><br>"                      
            'Visit User + Date + Visited URL
            if split(timestamp," ")(0) = FormatDateTime(date) then
                oTextStream.WriteLine "<tr><td nowrap><font color=green size=2>"&objNet.ComputerName&"</font></td>"+"<td nowrap><font color=red size=2>&nbsp;"&timeStamp&"</font></td>"&"<td nowrap><font size=2>&nbsp; <a href="&url&">"&url&"</a></font></td></tr>"
            end if
          End If 
        Next
    End Sub
    from the above section - not sure if thats where its getting its links from ?

    if you get it to work can you upload the working version here please

    ta
    Last edited by mac_shinobi; 10th February 2010 at 04:02 PM.

  9. #9
    Cools's Avatar
    Join Date
    Jan 2009
    Location
    Bedfordshire
    Posts
    498
    Thank Post
    24
    Thanked 62 Times in 57 Posts
    Rep Power
    25
    Mine working fine..
    Thanks People.. .

  10. #10
    Cools's Avatar
    Join Date
    Jan 2009
    Location
    Bedfordshire
    Posts
    498
    Thank Post
    24
    Thanked 62 Times in 57 Posts
    Rep Power
    25
    Just change Line 42 , 160 ,161 to your server
    Attached Files Attached Files

  11. #11
    neon's Avatar
    Join Date
    Apr 2009
    Location
    Market Harborough
    Posts
    222
    Thank Post
    7
    Thanked 22 Times in 20 Posts
    Rep Power
    15
    mine still doesnt show any websites

  12. #12
    Cools's Avatar
    Join Date
    Jan 2009
    Location
    Bedfordshire
    Posts
    498
    Thank Post
    24
    Thanked 62 Times in 57 Posts
    Rep Power
    25
    Run as admin...

  13. #13
    neon's Avatar
    Join Date
    Apr 2009
    Location
    Market Harborough
    Posts
    222
    Thank Post
    7
    Thanked 22 Times in 20 Posts
    Rep Power
    15
    am doing mate. Still nothing

SHARE:
+ Post New Thread

Similar Threads

  1. Logging Internet Usage
    By binky in forum How do you do....it?
    Replies: 40
    Last Post: 20th March 2013, 03:34 PM
  2. Secondary INet Filtering
    By buzzard in forum How do you do....it?
    Replies: 2
    Last Post: 17th October 2008, 03:40 PM
  3. Logging onto the network after logging on locally
    By frankybaloney in forum Windows
    Replies: 9
    Last Post: 10th October 2008, 12:17 PM
  4. Can you update Internet mobile to Internet Explorer?
    By thegrassisgreener in forum Windows
    Replies: 1
    Last Post: 16th July 2007, 01:48 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •