Page 1 of 1

How to find out %Program Files%

Posted: Wed Sep 23, 2009 12:40 pm
by ellano
Hi All

Since programs are installed by default on "Program files" (on French, German, or English OS) or "Archivos de Programas" on Spanish ones, my question is: Is there any way to find out with a simple function the name of this directory (or registrer key). This will be useful, for example, to display videos at demand:

cOpc[1]:=LFN2SFN(cOpc[3]+"program files\windows media player\wmplayer.exe")
cOpc[2]:=LFN2SFN(cOpc[3]+"program files\windows media player\mplayer2.exe")

Thanks
Emiliano Llano

Re: How to find out %Program Files%

Posted: Wed Sep 23, 2009 1:26 pm
by arpipeline
Ellano,

I am sure there is a registry key for the Current User, but we use the GetEnv function quite a bit for Windows Folders:

GetEnv( "PROGRAMFILES" )
GetEnv( "TEMP" )
GetEnv( "USERPROFILE" )

etc.

Andy

Re: How to find out %Program Files%

Posted: Wed Sep 23, 2009 5:12 pm
by ellano
Yeah! Thanks, forgot about this Clipper function, Although it also includes the system disk.

%Program Files% in the registry key is

HKLM/system/currentcontrolset/control/session manager/Environment/ProgramFiles

Just in case

Emiliano Llano