See when process exits in Windows XP

Brad Tilley rtilley at vt.edu
Sun Oct 17 04:59:28 CEST 2004


I posted the wrong function... here's the one that works:

def wait_for_ntbackup_to_exit(procname):
     while True:
         try:
             pids = win32pdhutil.FindPerformanceAttributesByName(procname)
             if len(pids) > 0:
                 ## If ntbackup is running, loop until it closes.
                 print pids
                 print len(pids)
                 print "ntbackup is running... waiting for it to exit."
                 continue
             else:
                 ## ntbackup is not running.
                 break
         except:
             return



More information about the Python-list mailing list