Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import ctypes
  2. from ctypes import wintypes, windll
  3.  
  4. CSIDL_LOCAL_APPDATA = 28
  5.  
  6. _SHGetFolderPath = windll.shell32.SHGetFolderPathW
  7. _SHGetFolderPath.argtypes = [wintypes.HWND,
  8. ctypes.c_int,
  9. wintypes.HANDLE,
  10. wintypes.DWORD, wintypes.LPCWSTR]
  11.  
  12.  
  13. path_buf = wintypes.create_unicode_buffer(wintypes.MAX_PATH)
  14. result = _SHGetFolderPath(0, CSIDL_LOCAL_APPDATA, 0, 0, path_buf)
  15.  
  16. print path_buf.value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement