Basic Univers
; German forum: http://robsite.de/php/pureboard/viewtopic.php?t = 2397&highlight =
; Author: NoOneKnows
; Date: 27. September 2003

; Tested on WinXP + Win2000...
#TOKEN_QUERY = $08

Procedure.s GetUserProfileDirectory()
    OpenProcessToken_(GetCurrentProcess_(), #TOKEN_QUERY, @token)

    Length.l = 512
    directory$ = Space(Length)
    
    GetUserProfileDirectory_(token, directory$, @Length)
    ProcedureReturn Left(directory$, Length) + "\"
EndProcedure

Debug "Desktop-Verzeichnis: " + GetUserProfileDirectory() + "Desktop\"