Re: WinNT/XP/2003: USERPROFILE vs. HOMEPATH
>> 2. SHGetSpecialFolderPath(NULL, lpzsPath, CSIDL_APPDATA, FALSE);Minimum operating systems: Windows 95/NT with Internet Explorer 4.0.
> For older versions of MS-Windows CSIDL_* might not be supported. Can
> this be detected or would it lead to unpredictable results?
I guess that otherwise SHGetSpecialFolderPath() returns FALSE. One
other method might be to check of %windir%\system32\shfolder.dll is
present. But perhaps, somebody else knows more.
> To make it even more complicated we would do the search twice:That would be great! Then $HOME would be where the users vimrc
> First to find a vimrc and when that fails take the first one that
> is defined.
resides. In this case, the order of points 2 and 3 is not so
important any more.
> Perhaps it's indeed better to leave the SHGetSpecialFolderPath()I do not define $HOME because of two reasons:
> out and tell the user to set $HOME if they want something
1) HOME is a very general named variable. (I would prefer VIM_HOME).
2) It is very cumbersome if every user have to define his HOME,
and I don't know how to automate this process.
My way is to put a short, hidden vimrc at a place where vim expects
it ($HOMEDRIVE$HOMEPATH) and then redirect vim (with source) to
SHGetSpecialFolderPath(NULL, lpzsPath, CSIDL_APPDATA, FALSE). I
could also define HOME within vimrc, I guess, but this isn't necessary.
But if I run vim with "runas", then $HOMEDRIVE$HOMEPATH is not
defined (and probably also wouldn't $HOME be defined). This is my