- language independent
- Windows version independent
- "full path" - I mean: the returned string should include drive letter
It doesn't even has to be TCL-based - in fact, the best would be something,
which I could use in ordinary Windows batch file, then pass to the
TCL-program as parameter.
Googling around I didn't find any environmental variables, unfortunately.
--
ZB
(base) 49 % package require twapi
2.0b12
(base) 50 % twapi::get_shell_folder common_desktopdirectory
C:\Documents and Settings\All Users\Desktop
(base) 51 % twapi::get_shell_folder desktopdirectory
C:\Documents and Settings\ashok\Desktop
The issue with methods such as this is that they will not work on
localized system where the desktop folder is not called "Desktop".
I believe the paths are also stored in the registry somewhere. You can
perhaps use regedit to search for Desktop and find out what the
relevant keys are.
/Ashok
Or the registry package that comes with - at least - ActiveTcl
on Windows.
Regards,
Arjen
I'd far rather use ActiveTcl than fuss with generation of the
standard Windows build, of course, when feasible.
I wasn't quite sure of that, hence the proviso. But I have used
it in the recent past with good results. No need to temper with
the registry via regedit that way :).
Regards,
Arjen
> I believe the paths are also stored in the registry somewhere.
Yes, meanwhile I've been told, that f.e. "Desktop" one can find in:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User \
Shell Folders\Desktop
So, there are a few alternate ways.
--
ZB
MSDN speaks of one small problem with just reading the registry (not
really relevant in practice). Those keys are only created if some
other process has called the SHGetSpecialFolders() API first at least
once. But unless your writing something really early up in the
installation process or so that should nearly always be a given fact.
Michael