윈도우 시스템에서 스크립트는 아주 유용한 자료중에 하나이다. 시스템 관리자가 적절하게 작업 시 자동화 할 수 있는 툴에 하나 이기도 하다.
------------------- Retrieve Operating System Properties -------------------------
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & " ootcimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo "Boot Device: " & objOperatingSystem.BootDevice
Wscript.Echo "Build Number: " & objOperatingSystem.BuildNumber
Wscript.Echo "Build Type: " & objOperatingSystem.BuildType
Wscript.Echo "Caption: " & objOperatingSystem.Caption
Wscript.Echo "Code Set: " & objOperatingSystem.CodeSet
Wscript.Echo "Country Code: " & objOperatingSystem.CountryCode
Wscript.Echo "Debug: " & objOperatingSystem.Debug
Wscript.Echo "Encryption Level: " & objOperatingSystem.EncryptionLevel
dtmConvertedDate.Value = objOperatingSystem.InstallDate
dtmInstallDate = dtmConvertedDate.GetVarDate
Wscript.Echo "Install Date: " & dtmInstallDate
Wscript.Echo "Licensed Users: " & _
objOperatingSystem.NumberOfLicensedUsers
Wscript.Echo "Organization: " & objOperatingSystem.Organization
Wscript.Echo "OS Language: " & objOperatingSystem.OSLanguage
Wscript.Echo "OS Product Suite: " & objOperatingSystem.OSProductSuite
Wscript.Echo "OS Type: " & objOperatingSystem.OSType
Wscript.Echo "Primary: " & objOperatingSystem.Primary
Wscript.Echo "Registered User: " & objOperatingSystem.RegisteredUser
Wscript.Echo "Serial Number: " & objOperatingSystem.SerialNumber
Wscript.Echo "Version: " & objOperatingSystem.Version
Next
----------------------------------------------------------------------------
위 내용을 메모장으로 복사 후 확장자 *.vbs 로 저장 후 커맨드로 아래와 같이 작업 하시길 바랍니다.
#cscript //H:CScript - 기본 스크립트 호스트를 CScript.exe로 변경합니다.
로 작업 후 하시길 바랍니다.
'FAQ Topics > Windows Scripting Host' 카테고리의 다른 글
| 메일 보내는 방법중에 텍스트 파일을 첨부 해서 보내는 방법 (0) | 2003/10/18 |
|---|---|
| 스크립트로 메일 보내는 방법 소개 (0) | 2003/10/18 |
| 운영체제 정보을 알고자 할때 사용하는 스크립트 정보자료 (0) | 2003/10/18 |
| 커맨드에서 이벤트 로그에 에러(error 객체) 로그만 볼려고 한다 어떻게 하는가? (0) | 2003/05/28 |
| W2K에서 디폴트 스크립트 엔진을 설정하는 방법은? (0) | 2000/10/29 |
| 커맨드라인에서 WSH를 실행하는 방법은 ?(번역안됨) (0) | 2000/10/29 |



댓글을 달아 주세요