Created
February 20, 2019 12:45
-
-
Save kumekay/727a132f48eeea83abf313bae122abd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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