2025-11-28 00:35:46 +09:00

33 lines
999 B
HTML

<!- Copyright (c) Microsoft Corporation, All Rights Reserved ->
<html>
<!-------------------------------------------------------------------------
This sample illustrates the use of the WMI Scripting API within
an HTML page, using VBScript. It displays a Win32_service name
using the synchronous API.
The WMI Scripting objects are instantiated using their CLSID's
and the HTML <OBJECT> tag.
---------------------------------------------------------------------------->
<head>
<title>WMI Scripting HTML Sample - Service Display 1 (VBScript synchronous version)</title>
<script LANGUAGE="VBScript">
Sub window_onload
Set Service = Locator.ConnectServer()
Set Process = Service.Get("Win32_Service.Name=""Winmgmt""")
document.all.info.innerText = Process.DisplayName
end sub
</script>
</head>
<body>
<p>The name of the WMI service is <span ID="info">unknown </span>.
<object ID="Locator" CLASSID="CLSID:76A64158-CB41-11D1-8B02-00600806D9B6">
</object>
</p>
</body>
</html>