Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29273 Discussions

how to get the local user home path etc.

tropfen
New Contributor I
676 Views
I would like to get the environment information for the current local user on an win xp or win 2000 system. The information should include the current home path of the user and the current temp directory.

Any help will be appreciatet.
Thanks in advance
Frank
0 Kudos
2 Replies
larsm
Beginner
676 Views

See GETDRIVEDIRQQ in module IFPORT, for example.

Lars

0 Kudos
Jugoslav_Dujic
Valued Contributor II
676 Views
USE DFWIN
CHARACTER(MAX_PATH):: sTemp, sHome
INTEGER:: iLen
iLen = GetTempPath(LEN(sTemp), s??mp)
iLen = ShGetSpecialFolderPath(0, sHome, CSIDL_PROFILE,0)

CSIDL_PROFILE returns the user settins root directory (typically Documents and SettingsUserName). Do not assume that "My documents" is within it if you need it (it is not for me, on the first place) -- use CSIDL_PERSONAL instead. Also, CSIDL_COMMON_APPDATA is the place where you should store your computer-global configuration files, and CSIDL_LOCAL_APPDATA is the place for user-specific files.

HTH,
Jugoslav
0 Kudos
Reply