Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to get location of Desktop folder on Win32

by jdporter (Canon)
on Apr 08, 2004 at 14:51 UTC ( #343616=note: print w/ replies, xml ) Need Help??


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

It's incredibly easy using Win32::OLE. You can use the application object named WScript.Shell.

use Win32::OLE; my $wsh = new Win32::OLE 'WScript.Shell'; my $desktop_path = $wsh->SpecialFolders('Desktop');
You can inquire about lots of other special folders using this interface:
  • Favorites
  • Fonts
  • MyDocuments
  • NetHood
  • PrintHood
  • Programs
  • Recent
  • SendTo
  • StartMenu
  • Startup
  • Templates
I don't know what versions of Windows have the WScript.Shell interface. The only Perl dependency is the Win32::OLE module.

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.


Comment on Re: How to get location of Desktop folder on Win32
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://343616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2015-07-07 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (91 votes), past polls