Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import ctypes
from ctypes import wintypes, windll
CSIDL_LOCAL_APPDATA = 28
_SHGetFolderPath = windll.shell32.SHGetFolderPathW
_SHGetFolderPath.argtypes = [wintypes.HWND,
ctypes.c_int,
wintypes.HANDLE,
wintypes.DWORD, wintypes.LPCWSTR]
path_buf = wintypes.create_unicode_buffer(wintypes.MAX_PATH)
result = _SHGetFolderPath(0, CSIDL_LOCAL_APPDATA, 0, 0, path_buf)
print path_buf.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment