WMI 가지고 노는 예제.
MAC 같은 입력하기 짜증나는 정보를 자동 입력할 때 이용하면 편리함
되면 지원하고 안 되면 직접 입력하게 하면 되니까 후후후
어 근데 보안설정 내리지 않고는 불가능하군 -_- 다른 방법이 없나.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>WMI Test</title>
<script type="text/vbscript">
Sub WindowsLoad
Set wmiService = CreateObject("WbemScripting.SWbemLocator").ConnectServer(".", "\root\cimv2")
Set operatingSystems = wmiService.ExecQuery("Select * from Win32_OperatingSystem")
For Each operatingSystem in operatingSystems
buffer = buffer & "Operating System: " & operatingSystem.Caption & "<br/>"
buffer = buffer & "Version: " & operatingSystem.Version & "<br/>"
Next
scanResult.InnerHtml = buffer
End Sub
</script>
</head>
<body>
<input type="button" value = "Run Script" name = "Run_Button" onclick = "WindowsLoad" /><br/>
<span id="scanResult"></span>
</body>
</html>
MAC 같은 입력하기 짜증나는 정보를 자동 입력할 때 이용하면 편리함
되면 지원하고 안 되면 직접 입력하게 하면 되니까 후후후
어 근데 보안설정 내리지 않고는 불가능하군 -_- 다른 방법이 없나.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>WMI Test</title>
<script type="text/vbscript">
Sub WindowsLoad
Set wmiService = CreateObject("WbemScripting.SWbemLocator").ConnectServer(".", "\root\cimv2")
Set operatingSystems = wmiService.ExecQuery("Select * from Win32_OperatingSystem")
For Each operatingSystem in operatingSystems
buffer = buffer & "Operating System: " & operatingSystem.Caption & "<br/>"
buffer = buffer & "Version: " & operatingSystem.Version & "<br/>"
Next
scanResult.InnerHtml = buffer
End Sub
</script>
</head>
<body>
<input type="button" value = "Run Script" name = "Run_Button" onclick = "WindowsLoad" /><br/>
<span id="scanResult"></span>
</body>
</html>




덧글