wsman com 链路记录
前言:wsman com 链路记录
Set objWsman = CreateObject( "WSMan.Automation" )
If objWsman is Nothing Then
WScript.Echo "Failed to create WSMAN Automation object"
WScript.Quit
End If
Set objSession = objWsman.CreateSession
If objSession is Nothing Then
WScript.Echo "Failed to create WSMAN Session object"
WScript.Quit
End If
strResource = "http://schemas.microsoft.com/wbem/wsman/1/" & _
"wmi/root/cimv2/Win32_Process"
strInputParameters = "<p:Create_INPUT " & _
"xmlns:p=""http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Process"">" & _
"<p:CommandLine>" & "C:\Users\Public\AVTEST.exe" & _
"</p:CommandLine>" & _
"</p:Create_INPUT>"
strOutputParameters = objSession.Invoke( "Create", _
strResource, strInputParameters )
DisplayOutput( strOutputParameters )
'****************************************************
' Displays WinRM XML message using built-in XSL
'****************************************************
Sub DisplayOutput( strWinRMXml )
Dim xmlFile, xslFile
Set xmlFile = CreateObject( "MSXml2.DOMDocument.3.0" )
Set xslFile = CreateObject( "MSXml2.DOMDocument.3.0" )
xmlFile.LoadXml( strWinRMXml )
xslFile.Load( "WsmTxt.xsl" )
Wscript.Echo xmlFile.TransformNode( xslFile )
End Sub

浙公网安备 33010602011771号