Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A question to Windows users

0 views
Skip to first unread message

ZB

unread,
Oct 12, 2008, 12:02:31 PM10/12/08
to
Perhaps someone of you could make a tip, how one could find a full path
to "desktop" folder? Of course, the solution should be:

- 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

APN

unread,
Oct 12, 2008, 1:23:17 PM10/12/08
to

(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

rf

unread,
Oct 12, 2008, 1:52:11 PM10/12/08
to
parray env
#will show the defined environment variables
#the desired path could be
set path [file join $env(USERPROFILE) Desktop]

APN

unread,
Oct 13, 2008, 6:27:12 AM10/13/08
to

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

Arjen Markus

unread,
Oct 13, 2008, 8:00:05 AM10/13/08
to

Or the registry package that comes with - at least - ActiveTcl
on Windows.

Regards,

Arjen

Cameron Laird

unread,
Oct 13, 2008, 10:06:09 AM10/13/08
to
In article <1a7120cf-9a65-42d4...@i76g2000hsf.googlegroups.com>,
Arjen Markus <arjen....@wldelft.nl> wrote:
.
.
.

>Or the registry package that comes with - at least - ActiveTcl
>on Windows.
.
.
.
Remarkably, the registry package has been part of the standard
Windows build since about 8.0; it has NOT been necessary to go
to ActiveTcl for it.

I'd far rather use ActiveTcl than fuss with generation of the
standard Windows build, of course, when feasible.

Arjen Markus

unread,
Oct 14, 2008, 2:26:40 AM10/14/08
to
On 13 okt, 16:06, cla...@lairds.us (Cameron Laird) wrote:
> In article <1a7120cf-9a65-42d4-b3a5-fd76b2c47...@i76g2000hsf.googlegroups.com>,

> Arjen Markus  <arjen.mar...@wldelft.nl> wrote:
>                         .
>                         .
>                         .>Or the registry package that comes with - at least - ActiveTcl
> >on Windows.
>
>                         .
>                         .
>                         .
> Remarkably, the registry package has been part of the standard
> Windows build since about 8.0; it has NOT been necessary to go
> to ActiveTcl for it.
>

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

ZB

unread,
Oct 14, 2008, 7:36:40 PM10/14/08
to
Dnia 13.10.2008 APN <pal...@yahoo.com> napisał/a:

> 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

schlenk

unread,
Oct 16, 2008, 9:31:50 AM10/16/08
to
On Oct 15, 1:36 am, ZB <zbREMOVE_THIS@AND_THISispid.com.pl> wrote:
> Dnia 13.10.2008 APN <palm...@yahoo.com> napisa³/a:

>
> > 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.

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

0 new messages