See when process exits in Windows XP

Brad Tilley rtilley at vt.edu
Sat Oct 16 22:59:28 EDT 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