por asimoes » 18 Jul 2019 13:53
Objeto FileSystemObject
#define SystemFolder 1 //The Windows system folder (/windows/system or /windows/system32)
#define TemporaryFolder 2 //The folder that stores temporary files (../windows/temp)
#define WindowsFolder 0 //The root folder of the Windows system folder tree (/windows or /winnt)
cPathName := GetSpecialFolder( TemporaryFolder ) // Retorna o path da pasta temp do usuário
FUNCTION GetSpecialFolder( nFolderSpec )
LOCAL oFile, lOk := .T., cPathName := ""
Hb_Default(@nFolderSpec , 0)
BEGIN SEQUENCE WITH __BreakBlock()
oFile := Win_OlecreateObject("Scripting.FileSystemObject")
RECOVER
lOk := .F.
END
IF lOk
BEGIN SEQUENCE WITH __BreakBlock()
WITH OBJECT oFile
cPathName := :GetSpecialFolder( nFolderSpec ):Path
END
RECOVER
cPathName := ""
END
ENDIF
RETURN cPathName
â–ºHarbour 3.x | Minigui xx-x | HwGuiâ—„
Pense nas possibilidades abstraia as dificuldades.
Não corrigir nossas falhas é o mesmo que cometer novos erros.
A imaginação é mais importante que o conhecimento. (Albert Einstein)