PC Review
Forums
Newsgroups
Windows XP
Windows XP WMI
WMI for printer page count
Forums
Newsgroups
Windows XP
Windows XP WMI
WMI for printer page count
![]() |
WMI for printer page count |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
I would like to write a program that gets the printer page count from several network printers (all connected to 1 print server). I think WMI is suited for that purpose but I don't know exactly how to start. Anyone who can help with some sample code or pointers to usefull websites. Thanks, WiWa |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Here's a script to get you started. Below is also some links for further
information. const wbemFlagReturnImmediately = &h10 const wbemFlagForwardOnly = &h20 strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMv2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PrintJob", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) for each objItem In colItems wscript.echo "Print Job:" & vbTab & objItem.Name wscript.echo "Total Pages:" & vbTab & objItem.TotalPages wscript.echo "PagesPrinted:" & vbTab & objItem.PagesPrinted wscript.echo next WMI capabilities also include eventing, remoting, querying, views, user extensions to schema, instrumentation, and more. To learn more about WMI, go to http://msdn.microsoft.com/library/default.asp and search for the keyword phrase "About WMI" The Microsoft Developers Network (MSDN) and TechNet are both good sources of samples. Here are some links to useful locations on these sites: . The TechNet Script Center Includes hundreds of sample scripts categorized by technology and administrative task. http://go.microsoft.com/fwlink/?LinkId=24771. . MSDN http://msdn.microsoft.com/library. For WMI scripts, search for "WMI System Administration scripts". For WMIC (the WMI Command Line Utility), see http://msdn.microsoft.com/library/d...dk/wmi/wmic.asp . . The WMI Software Developers Kit (SDK) http://www.microsoft.com/msdownload...rmsdk/sdkupdate For a set of problem solutions by category, see Using WMI > WMI Tasks for Scripts and Applications. . The Windows 2000 Scripting Guide online The complete text of the book, which includes many examples of WMI scripting. http://www.microsoft.com/resources/...us/default.mspx . The "Tales from the Script" column on TechNet Basic and intermediate scripting topics. http://www.microsoft.com/technet/co...ts/default.mspx . The "Scripting Clinic" column on MSDN More advanced scripting topics. http://msdn.microsoft.com/library/d...tentid=28001169 . Newsgroups You can post questions about WMI and WMI applications or scripts to several newsgroups on the Msnews.microsoft.com news server: Microsoft.public.win32.programmer.wmi Microsoft.public.windowsxp.wmi Microsoft.public.windows.server.scripting -- Philip Nunn [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm. "wiwa" <wim_wauters@skynet.be> wrote in message news:4129096e$0$4139$ba620e4c@news.skynet.be... > Hi, > > I would like to write a program that gets the printer page count from > several network printers (all connected to 1 print server). I think WMI is > suited for that purpose but I don't know exactly how to start. Anyone who > can help with some sample code or pointers to usefull websites. > > Thanks, > > WiWa > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

