How to find out %Program Files%

Post Reply
ellano
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am

How to find out %Program Files%

Post 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
User avatar
arpipeline
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States

Re: How to find out %Program Files%

Post 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
ellano
Posts: 107
Joined: Tue Sep 15, 2009 7:52 am

Re: How to find out %Program Files%

Post 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
Post Reply