View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Cush Cush is offline
external usenet poster
 
Posts: 126
Default Locating a user's Program Files

I am able to locate a users desktop with the following code:

Set WSHShell = CreateObject("WScript.Shell")
sPath = WSHShell.specialfolders("Desktop")

I need something similar to locate the Program Files, which are not always
located at C:\Program Files

I tried:
Set WSHShell = CreateObject("WScript.Shell")
sPath = WSHShell.SpecialFolders("Program Files")

both with and without the space, but it only turned up
an empty string.

sPath = WSHShell.SpecialFolders("Programs")
returns : \Start Menu\Programs


Any clues?
Also, where can I find the object model for this?