Either I must be looking in the wrong location or I'm the first to ask
this question (probably the first), but I do not know how to get the
user's "My Documents" location of Windows from Tcl/Tk. This question
would also apply to "My Pictures", etc.
I want to use it because I want my Tcl program to store the data files
in the "My Documents" directory, and not in the directory where I
store my program (that is: c:\Program Files\<my program name>)
Roalt
"RA" <googl...@roalt.com> wrote in message
news:271727eb.04100...@posting.google.com...
George
"USCode" <usc...@dontspam.me> wrote in message
news:yOednYqfruc...@comcast.com...
> Did you look for them at:
> C:\Documents and Settings\(user name)\My Documents
> ?
USCode, descriptive alias, indeed. Try that with localized Windows. Or
with XP and moved My Documents folder. No offense :)
I still haven't graduated from expert school, but this is what I would
try (sorry for excess line length).
registry get {HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders} {Personal}
That gives us (me, English W2k) "%USERPROFILE%\My Documents". Magic env()
gives %USERPROFILE% from
set env(USERPROFILE)
and rest is fiddling around with appending and replacing and messing up
backslashes, and wondering whether this is portable at all. Next step
after that is to play with [registry values] and find rest of all that
interesting information there is.
That was my best shot, now make it right, folks :)
> "RA" <googl...@roalt.com> wrote
> >
> > Either I must be looking in the wrong location or I'm the first to ask
> > this question (probably the first), but I do not know how to get the
> > user's "My Documents" location of Windows from Tcl/Tk. This question
> > would also apply to "My Pictures", etc.
--
-Kaitzschu
echo "\|/ ____ \|/>\"@'/ ,. \\\`@\">/_| \__/ |_\> \__U_/" | sed -e "s/>/\n/g"
Bzzzt. Not if you installed to drive D:, renamed the user, and then
moved the My Documents folder to someplace else. :)
There are a variety of environment variables and registry entries that
will tell you where this is, and probably a system call as well.
It was just a suggestion...maybe I misunderstood his post.
Thanks for the tip! I think this is indeed the best way to get the 'My
Documents' folder, as I know it can be moved to another location than
c:\Documents and Settings\<user name>\...
Now see if this tip makes it into Tcl-URL... :-)
Roalt