Đang chuẩn bị liên kết để tải về tài liệu:
Windows Admin Scripting Little Black Book- P17

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Windows Admin Scripting Little Black Book- P17:This book may not be duplicated in any way without the express written consent of the publisher, except in the form of brief excerpts or quotations for the purposes of review. The information contained herein is for the personal use of the reader and may not be incorporated in any commercial programs, other books, databases, or any kind of software without written consent of the publisher. Making copies of this book or any portion for any purpose other than your own is a violation of United States copyright laws | The Win32_CDROMDrive class allows you to query CD-ROM information through WMI. To collect CD-ROM information on a system using WMI proceed as follows 1. Create a new directory to store all files included in this example. 2. Download and install the latest version of Windows Script Host from www.microsoft.com to the new directory. 3. Select Start Run and enter cscript scriptfile.vbs . Here scriptfile is the full path and file name of a script file that contains the following Set CDSet GetObject winmgmts .InstancesOf Win32 CDROMDrive For each CD in CDSet WScript.Echo Name CD.Name VBlf Drive CD.Drive VBlf Status CD.Status Next Note The highlighted code above must be placed on one line. Collecting Drive Information The Win32_LogicalDisk class allows you to query disk information through WMI. To inventory disks on a system using WMI proceed as follows 1. Create a new directory to store all files included in this example. 2. Download and install the latest version of Windows Script Host from www.microsoft.com to the new directory. 3. Select Start Run and enter cscript scriptfile.vbs . Here scriptfile is the full path and file name of a script file that contains the following Set DiskSet GetObject winmgmts .InstancesOf Win32 LogicalDisk For each Disk in DiskSet Select Case Disk.DriveType Case 0 DType Unknown Case 1 DType No Root Directory Case 2 DType Removable Disk Case 3 DType Local Disk Case 4 DType Network Drive Case 5 DType Compact Disc Case 6 DType RAM Disk End Select WScript.Echo Drive Disk.DevicelD VBlf Name Disk.Description VBlf Type DType VBlf File System Disk.FileSystem VBlf Size Disk.Size VBlf Free Space Disk.FreeSpace VBlf Compressed Disk.Compressed Next Note The highlighted code above must be placed on one line. Collecting Memory Information The Win32_LogicalMemoryConfiguration class allows you to query memory information through WMI. To collect memory information on a system using WMI proceed as follows 1. Create a new directory to store all files included