How Use this in fwh ?
https://docs.microsoft.com/en-us/windows/win32/api/userenv/nf-userenv-getuserprofiledirectorya
GetUserProfileDirectoryA function of Windows 10
I wish Know the right directory of \users\nameuser\
Dim sBuffer As String, Ret As Long, hToken As Long
Declare Function GetUserProfileDirectory Lib "userenv.dll" Alias "GetUserProfileDirectoryA" (ByVal hToken As Long, ByVal lpProfileDir As String, ByVal lpcchSize As Long) As Boolean
Sub Main()
Dim SpecialFolder As String
Dim fs As Object
Dim oldPath As String, newPath As String, specialPath As String
specialPath = GetUserProfileDirectory(hToken, sBuffer, 255)
oldPath = "H:\"
newPath = "specialPath"
fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile(oldPath & "\" & "January2009.txt", newPath & "\" & "January2009.txt")
fs = Nothing
End Sub
FUNCTION GetDesktopDir()
LOCAL Result:=""
Result := GETENV("USERPROFILE")+"\Desktop"
RETURN Result
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 47 guests