Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Path to My Documents in W2K and 98
Message
General information
Forum:
Windows
Category:
Other
Miscellaneous
Thread ID:
00698633
Message ID:
00699070
Views:
17
>I have an application using My Documents and I have two sets of the same data but one is on a 98 and another is on W2K, residing in My Documents. The path to My Documents is hard coded in the W2K machine c:\Documents and Setting ......\My Documents\DirName\FileName.ext now the same data on the 98 machine is just c:\My Documents\DirName\FileName.ext. I doubt if the application will be able to use env. vars.
>
>Any suggesstions. Right now I have created a similar directory structure in 98 but it doesn't feel right.

It's much simpler than you make it out - the Shell.Application object has a SpecialFolders collection which includes the "My Documents" folder for the current user, and there are a series of Shell API functions such as SHGetFolderPath() that use the CSIDL (a unique, cross platform special folder reference which is resolvable via the registry) which provides a mechanism to do this - it also allows you to find other special folder paths such as the Application Data and Local Data paths of the current user for OS that support such. This is the Windows-approved method for resolving special folder relative references.
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
Next
Reply
Map
View

Click here to load this message in the networking platform