shellexecuteex.py 521 B

123456789101112131415
  1. from win32com.shell import shell, shellcon
  2. import win32con
  3. def ExplorePIDL():
  4. pidl = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP)
  5. print("The desktop is at", shell.SHGetPathFromIDList(pidl))
  6. shell.ShellExecuteEx(fMask=shellcon.SEE_MASK_NOCLOSEPROCESS,
  7. nShow=win32con.SW_NORMAL,
  8. lpClass="folder",
  9. lpVerb="explore",
  10. lpIDList=pidl)
  11. print("Done!")
  12. if __name__=='__main__':
  13. ExplorePIDL()