I use winXP.
For me,
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir
contained a value of: C:\program files
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesPath
contained a value of: %ProgramFiles%
which looks a lot like a way to refer to an environment variable.
Like using Windows start button|run
and typing:
%temp%
to get to the user's temp folder
%programfiles%
took me to my c:\program files folder.
Peter T wrote:
>
> Hi Dave,
>
> > Do you know if this would work in the 9x series?
> >
> > If sPath = "" Then
> > sPath = WSHShell.RegRead _
> > ("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir")
> > End If
>
> Yes, that worked for me in W98SE when I ran your testme02 as posted earlier.
>
> sPath = WSHShell.environment("Process")("ProgramFiles")
> and
> MsgBox Environ("programfiles")
> both returned empty strings but without error.
>
> FWIW, I notice that besides "ProgramFilesDir" I also have
> "ProgramFilesPath", adjacent in the registry. Both show same path, as I
> would expect but wonder why the two keys.
>
> Regards,
> Peter T
--
Dave Peterson
Bookmarks