Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program Files folder - How to get the name?
Message
From
14/09/2002 11:22:13
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00700175
Message ID:
00700517
Views:
8
>Hi!
>
>It seems it is always following, but I'm not sure:
>
>
>&& GetWindowsDirectory to variable lcWinDir
>
>lcProgFilesDir = JustDrive(m.lcWinDir) + "\Program Files"
>
>

Not the case, especially under WinNT-family OS or Win9x versions with user profiles enabled. You want to use the Wscript.Shell SpecialFOlders collection to retireve the Program File directory:'
oShell = CREATEOBJ('Wscript.Shell)
oSpecFolder = oShell.SpecialFolders()
? oSpecFolder.item('program') - this is the program folder in the start menu
The "Program Files" directory is not in a standard location; it can be found at the same level as the Windows directory on the system volume, but there may be a Program FIles folder on multiple volumes. You'll need to consult the registry for the specific application of interest to determine exactly where the program files for the app are installed; in fact, a given app need not have been installed under the Program Files folder.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform