' stopticker.vbs ' updated by WIPAT 2554-10-05 ' log server ip MyHost = "10.0.6.2" strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") 'check curl.exe MyFile="C:\curl.exe" Set fs = CreateObject("Scripting.FileSystemObject") if (fs.FileExists(MyFile)) then MyWget = "C:\curl -o NUL -s " else wscript.quit() End if ' Get USERNAME Set WshShell = WScript.CreateObject("WScript.Shell") TickerFile= WshShell.Environment("PROCESS").Item("TEMP") _ + "\ticker-" + WshShell.Environment("PROCESS").Item("USERNAME") + ".txt" Set fs = CreateObject("Scripting.FileSystemObject") if not (fs.FileExists(TickerFile)) then wscript.Quit() Set a = fs.OpenTextFile(TickerFile) Header = a.ReadLine() a.close fs.DeleteFile(TickerFile) Info = split(Header,":") StartTime = Info(1) 'Get DATE and TIME Set colItems = objWMIService.ExecQuery( _ "Select * from Win32_LocalTime") For Each objItem in colItems exit for Next CurrentTime = objItem.Year & Right("0" & objItem.Month,2) _ & Right("0" & objItem.Day,2) & Right("0" & objItem.Hour,2) _ & Right("0" & objItem.Minute,2) & Right("0" & objItem.Second,2) AA = 3600*Mid(StartTime,9,2) + 60*Mid(StartTime,11,2) + Right(StartTime,2) BB = 3600*Mid(CurrentTime,9,2) + 60*Mid(CurrentTime,11,2) + Right(currentTime,2) if AA > BB Then BB = BB + 86400 Usage = BB - AA MyMessage = Header & ":LOGOFF:" & CurrentTime & ":" & Usage & ":" 'Wscript.Echo MyMessage 'MyWget = "C:\Program Files\GnuWin32\bin\wget -O NUL -q " MyURL = "http://" + Myhost +"/ticker/myticker.php?LOG=" + MyMessage Set WshShell = wscript.createobject("wscript.shell") 'Set oExec = WshShell.Exec(MyWget + " " + MyURL) wshshell.run MyWget + " " + MyURL,0, false ' Wait 2000 msec before logoff WScript.Sleep 2000