Board index » delphi » How to: get the path to any user's desktop

How to: get the path to any user's desktop

Hi,

I need to know how to get the path to any user's desktop dir...

Thanks.
Molna Sen.

 

Re:How to: get the path to any user's desktop


Hi Molna,

Look at SHGetSpecialFolderLocation

Cheers,
Rik

Quote
Molna Sen <molnasennos...@bigfoot.com> wrote in message

news:3b42ff12$1_1@dnews...
Quote

> Hi,

> I need to know how to get the path to any user's desktop dir...

> Thanks.
> Molna Sen.

Re:How to: get the path to any user's desktop


Quote
"Rik Barker" <rik.bar...@visionsoft.com> wrote:
>Hi Molna,

>Look at SHGetSpecialFolderLocation

Hi,

But I need to get the Desktop folder for every user. That function retrieves only the current user's folder.
Not only that, I'd need a list of all users on a machine, and then a list of all Desktop folders (one for each existing user) on a machine.

Thanks.

Regards,
Molna Sen.

Re:How to: get the path to any user's desktop


Molna,

I guess it depends on what you're trying to use it for.  If you're wanting
to put something on all their desktops, couldn't you use the C:\WINDOWS\All
Users\Desktop directory?

If you're supporting 95 (which I don't think had that), then you're limited
to one of two options, I think (if anyone knows different, jump in and tell
me)

Option 1 - right something that runs at startup for all users, reads their
desktop location and does whatever you need it to do.

Option 2 - stroll through the windows directory structure using
FindFirst/FindNext looking for directories called "Desktop" - not so nice,
since the folder can be renamed, and is something different in each
language.

Rik

Quote
Molna Sen <molnasennos...@bigfoot.com> wrote in message

news:3b443bb3$1_1@dnews...
Quote

> "Rik Barker" <rik.bar...@visionsoft.com> wrote:
> >Hi Molna,

> >Look at SHGetSpecialFolderLocation

> Hi,

> But I need to get the Desktop folder for every user. That function

retrieves only the current user's folder.
Quote
> Not only that, I'd need a list of all users on a machine, and then a list

of all Desktop folders (one for each existing user) on a machine.
Quote

> Thanks.

> Regards,
> Molna Sen.

Re:How to: get the path to any user's desktop


Hi Rik,

What I want is to access all desktop shortcuts from all users, which can be partially accomplished by using
the "All users" entry, but it's not enough.
I think it shouldn't be so complicated -I've searched quite a bit and found nothing- to get
a list of users and a list of desktop directories... Your ideas could help on the matter but there has to be
a "proper" way to obtain this info... ??
NT/2000, btw.

Thanks.
Regards,
Molna Sen.

Quote
"Rik Barker" <rik.bar...@visionsoft.com> wrote:
>Molna,>
>I guess it depends on what you're trying to use it for.  If you're wanting
>to put something on all their desktops, couldn't you use the C:\WINDOWS\All
>Users\Desktop directory?

>If you're supporting 95 (which I don't think had that), then you're limited
>to one of two options, I think (if anyone knows different, jump in and tell
>me)

>Option 1 - right something that runs at startup for all users, reads their
>desktop location and does whatever you need it to do.

>Option 2 - stroll through the windows directory structure using
>FindFirst/FindNext looking for directories called "Desktop" - not so nice,
>since the folder can be renamed, and is something different in each
>language.

>Rik

>Molna Sen <molnasennos...@bigfoot.com> wrote in message
>news:3b443bb3$1_1@dnews...

>> "Rik Barker" <rik.bar...@visionsoft.com> wrote:
>> >Hi Molna,

>> >Look at SHGetSpecialFolderLocation

>> Hi,

>> But I need to get the Desktop folder for every user. That function
>retrieves only the current user's folder.
>> Not only that, I'd need a list of all users on a machine, and then a list
>of all Desktop folders (one for each existing user) on a machine.

>> Thanks.

>> Regards,
>> Molna Sen.

Re:How to: get the path to any user's desktop


In article <3b42ff12$1_1@dnews>, molnasennos...@bigfoot.com says...

Quote

>Hi,

>I need to know how to get the path to any user's desktop dir...

>Thanks.
>Molna Sen.

you can search the path in the registry

Other Threads