2

This is the code I have now. This goes through the explorer. But I need a better option.

o = win32com.client.Dispatch("WScript.Shell")
        #o.SendKeys("#m")
        #time.sleep(5)
        import subprocess as sp
        p = sp.Popen(args='c:\\windows\\explorer.exe')
        #o.AppActivate("Recycle Bin")
        time.sleep(5)
        o.SendKeys("^z", 0)
        o.SendKeys("{ENTER}", 0)
        # wait for undo to finish
        time.sleep(10)
        o.SendKeys("%{F4}", 0)
        self.Pass('Undo deletion of %s to recycle bin')
        #
        self.Log("Finished")
Andy G
  • 19,232
  • 5
  • 47
  • 69
user3597409
  • 39
  • 1
  • 1
  • 7
  • What do you mean by "better"? What's wrong with your current approach? – dg99 May 16 '14 at 22:26
  • This gets weird on windows 8 and 8.1. And the machines in running on are very very slow. So if explorer pops up and it takes too long and I hit the ctrl z it just doesn't work. – user3597409 May 18 '14 at 16:21

0 Answers0