Last active
April 7, 2020 11:30
-
-
Save atnbueno/16f0ae24faccd44d034c to your computer and use it in GitHub Desktop.
How to get where's the Dropbox folder
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
If FileExist(A_AppData "\Dropbox\host.db") { | |
FileReadLine, EncodedDropboxFolder, % A_AppData "\Dropbox\host.db", 2 | |
MsgBox, 0x40, % "Get Dropbox folder", % "Read from host.db:`n" EncodedDropboxFolder "`n`nDecoded as Base64:`n" Base64ToString(EncodedDropboxFolder) | |
} Else { | |
MsgBox, 0x10, % "Get Dropbox folder", % "ERROR: host.db file not found" | |
} | |
; Based on code by Laszlo, found at http://autohotkey.com/board/topic/35618-/?p=224660 | |
Base64ToString(sBase64) { | |
DllCall("Crypt32.dll\CryptStringToBinary", UInt,&sBase64, UInt,StrLen(sBase64), UInt,1, UInt,0, UIntP,nSize, UInt,0, UInt,0, "CDECL UInt") | |
VarSetCapacity(Output, nSize) | |
DllCall("Crypt32.dll\CryptStringToBinary", UInt,&sBase64, UInt,StrLen(sBase64), UInt,1, UInt,&Output, UIntP,nSize, UInt,0, UInt,0, "CDECL UInt") | |
Return StrGet(&Output, "CP0") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment