#!/usr/bin/env python
"""counterid - Simple utility to discover perfmon counter paths"""
# Compile to EXE using c:\Python27\scripts\pyinstaller.exe -F counterid.py

__author__ = 'scottv@rbh.com (Scott Vintinner)'
import win32pdh


# Will display a window with available counters.  Click add to print out counter name.
def print_counter(counter):
    print counter

win32pdh.BrowseCounters(None, 0, print_counter, win32pdh.PERF_DETAIL_WIZARD, "Counter List")
@@ -14,17 +14,16 @@
 v python
-%0D
 %0A%22%22%22coun
@@ -81,17 +81,42 @@
 paths%22%22%22
-%0D
+%0A# pip install pyinstaller
 %0A# Compi
@@ -135,28 +135,8 @@
 ing 
-c:%5CPython27%5Cscripts%5C
 pyin
@@ -162,19 +162,17 @@
 terid.py
-%0D%0A%0D
+%0A
 %0A__autho
@@ -211,17 +211,16 @@
 tinner)'
-%0D
 %0Aimport 
@@ -231,13 +231,10 @@
 2pdh
-%0D%0A%0D%0A%0D
+%0A%0A
 %0A# W
@@ -316,17 +316,16 @@
 er name.
-%0D
 %0Adef pri
@@ -344,17 +344,16 @@
 ounter):
-%0D
 %0A    pri
@@ -358,19 +358,19 @@
 rint
- 
+(
 counter
-%0D%0A%0D
+)%0A%0A
 %0Awin

Update to make compatible with Python 3