Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: How to get location of Desktop folder on Win32

by AcidHawk (Vicar)
on Apr 08, 2004 at 10:36 UTC ( #343565=note: print w/replies, xml ) Need Help??

in reply to How to get location of Desktop folder on Win32

That kinda depends on what you are looking for...

If you are looking for directories to Desktop/Start Menu/Application Data, for the current user you could always look for the USERPROFILE environment setting with $ENV{'USERPROFILE'} then those 'special' directories are all under there.

You can then just add for example \\Desktop to that envirenment variable.

Below is a simple untested example:

my $path = $ENV{'USERPROFILE'}; $path =~s/\\/\//g; my $desktop_path = "$path/Desktop";
Of all the things I've lost in my life, its my mind I miss the most.

Replies are listed 'Best First'.
Re: Re: How to get location of Desktop folder on Win32
by eserte (Deacon) on Apr 08, 2004 at 10:58 UTC
    This is not a good solution. In non-english localizations the directory names are different (e.g. "My Documents" is "Meine Dokumente" in the German Windows version). Using an API function is the better solution.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://343565]
[Eily]: hello people \o/
[karlgoethebier]: manpages..
[Eily]: and non-people and NodeReaper
[Discipulus]: you so kid to greet non people..;=)
Discipulus kind not kid..
[Corion]: The bots bow in response
[Discipulus]: so karlgoethebier, what this idiom is and where i can read about it? i tried to deparse and gives error..;=(
[karlgoethebier]: Eily: non-people == persone non grata?
[Your Mother]: Corion: I have lost the link to the pmdev guide(s). Do you have that handy?
[karlgoethebier]: Discipulus: see per lop please how to avoid the classic <c>perl 'rm -rfv *|'</>

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2017-07-21 08:07 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (319 votes). Check out past polls.