Página 1 de 1
Caminho da Pasta Meus Documentos
Enviado: 14 Set 2012 13:09
por Paulo Pereira
Existe uma funcao ou maneira de saber o caminho da pasta meus documentos do usuario logado ??
Sabemos que começa em Documents and Settings , mas a subpasta muda..
Caminho da Pasta Meus Documentos
Enviado: 14 Set 2012 13:41
por Toledo
Amigo, veja se esta função resolve:
Código: Selecionar todos
Func Main()
? Get_Folder(1) //Desktop
? Get_Folder(2) //Meus Documentos
retu
Proc Get_Folder(nfolder)
Local objShell, RetFolder
Local aFolderName:={"Desktop","MyDocuments"}
nfolder:=iif(nfolder=nil,1,nfolder)
objShell := CreateObject("WScript.Shell")
RetFolder := objShell:SpecialFolders:Item(aFolderName[nfolder])
objShell := nil
RETURN RetFolder
Abraços,
Caminho da Pasta Meus Documentos
Enviado: 14 Set 2012 13:58
por Imatech
Olá Paulo Pereira !
Código: Selecionar todos
LOCAL cMyDocumentsPath := hb_getenv( "USERPROFILE" )
IF !( EMPTY( cMyDocumentsPath ) )
IF IsDirectory( cMyDocumentsPath+'\Documents' )
ALERT( 'Win Vista ou Superior' + ';;' + cMyDocumentsPath+'\Documents' )
ELSE
ALERT( 'Win XP ou Anterior' + ';;' + cMyDocumentsPath' )
ENDIF
ELSE
ALERT( 'hb_getenv retornou NULL' )
ENDIF
Windows 98 and Windows Me
C:\My Documents
Windows 2000 and Windows XP
%USERPROFILE%\My Documents
Windows Vista and later
%USERPROFILE%\Documents
Outras variaveis de ambiente no Windows...
%ALLUSERSPROFILE%
%PROGRAMDATA%
%APPDATA%
%COMPUTERNAME%
%COMMONPROGRAMFILES%
%COMMONPROGRAMFILES(x86)%
%COMSPEC%
%HOMEDRIVE%
%HOMEPATH%
%LOCALAPPDATA%
%LOGONSERVER%
%PATH%
%PATHEXT%
%PROGRAMDATA%
%PROGRAMFILES%
%PROGRAMFILES(X86)%
%PROMPT%
%PSModulePath%
%PUBLIC%
%SystemDrive%
%SystemRoot%
%TEMP%
%TMP%
%USERDOMAIN%
%USERNAME%
%USERPROFILE%
%WINDIR%
Caminho da Pasta Meus Documentos
Enviado: 14 Set 2012 19:49
por Paulo Pereira
show de bola...
Nao tinha pensado nessa variavel de ambiente...
Valeu
