웹에서 VBScript로 시스템 정보 얻기 코드

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>


트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://www.xeraph.com/tb/3545464 [도움말]

덧글

댓글 입력 영역