FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to find out %Program Files%
Posts: 107
Joined: Tue Sep 15, 2009 07:52 AM
How to find out %Program Files%
Posted: Wed Sep 23, 2009 12:40 PM

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

Posts: 36
Joined: Thu Oct 26, 2006 05:23 PM
Re: How to find out %Program Files%
Posted: Wed Sep 23, 2009 01:26 PM

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

Posts: 107
Joined: Tue Sep 15, 2009 07:52 AM
Re: How to find out %Program Files%
Posted: Wed Sep 23, 2009 05:12 PM

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

Continue the discussion