Microsoft Windows Scripting Self-Paced Learning Guide
http://www.mums.ac.ir/shares/hit/eduhit/book/windowsscripting.pdf
http://support.microsoft.com/kb/926352/en-us
https://www.microsoft.com/learning/en-us/book.aspx?id=6789
FilterPrinterStatus.vbs
Option Explicit 'On Error Resume Next Dim strComputer Dim wmiNS Dim wmiQuery Dim objWMIService Dim colItems Dim objItem Dim strStatus strComputer = "." wmiNS = "\root\cimv2" wmiQuery = "Select * from Win32_Printer" _ & " Where PrinterStatus = 1" _ & " or PrinterStatus = 2" _ & " or PrinterStatus = 7" Set objWMIService = GetObject("winmgmts:\\" _ & strComputer & wmiNS) Set colItems = objWMIService.ExecQuery(wmiQuery) If colItems.Count = 0 Then WScript.Echo "all printers are fine" Else For Each objItem In colItems WScript.Echo "Name: " & objItem.Name WScript.Echo "Location: " & objItem.Location subEvalStatus WScript.Echo "Printer Status: " & strStatus WScript.Echo "Server Name: " & objItem.ServerName WScript.Echo "Share Name: " & objItem.ShareName WScript.Echo Next End If Sub subEvalStatus Select Case objItem.PrinterStatus Case 1 strStatus = "Other" Case 2 strStatus = "Unknown" Case 3 strStatus = "Idle" Case 4 strStatus = "Printing" Case 5 strStatus = "Warmup" Case 6 strStatus = "Stopped Printing" Case 7 strStatus = "Offline" End Select End Sub
哲学管理(学)人生, 文学艺术生活, 自动(计算机学)物理(学)工作, 生物(学)化学逆境, 历史(学)测绘(学)时间, 经济(学)数学金钱(理财), 心理(学)医学情绪, 诗词美容情感, 美学建筑(学)家园, 解构建构(分析)整合学习, 智商情商(IQ、EQ)运筹(学)生存.---Geovin Du(涂聚文)