Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How to get location of Desktop folder on Win32

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 06: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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://343565]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.