What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » How to obtain the Desktop path

How to obtain the Desktop path
Author: Message:
johny65
New Member
*

Avatar
~777~

Posts: 7
36 / Male / Flag
Joined: Jul 2007
O.P. How to obtain the Desktop path
Hi!
I would like to know how to get the Desktop path with a script, and also other paths, like Windows folder or System folder.
Thanks!
08-08-2007 11:27 PM
Profile PM Web Find Quote Report
mondator
New Member
*


Posts: 10
Joined: Aug 2007
RE: How to obtain the Desktop path
use the global windows var like %USERPROFILE%\ the full path of the current windows user folder its very useful u can acces desktop or my documents exemple:   %USERPROFILE%\Desktop to get the desktop path but this work only to give it to a function ho interact with path like sendfile if u want the path in a var in your script see the solution below:)

This post was edited on 08-08-2007 at 11:50 PM by mondator.
08-08-2007 11:38 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: How to obtain the Desktop path
You can get some special folders using the following code.
code:
var WSH = new ActiveXObject("WScript.Shell");
var folder = WSH.SpecialFolders(folderLookup);

folderLookup is a string and can be any of the following:
  • AllUsersDesktop
  • AllUsersStartMenu
  • AllUsersPrograms
  • AllUsersStartup
  • Desktop
  • Favorites
  • Fonts
  • MyDocuments
  • NetHood
  • PrintHood
  • Programs
  • Recent
  • SendTo
  • StartMenu
  • Startup
  • Templates
I think the reason for not allowing access to the likes of the system folder is primarily for security reasons.
[Image: markee.png]
08-08-2007 11:40 PM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: How to obtain the Desktop path
you can also use this, and then you get access to everything listed here
http://msdn2.microsoft.com/en-us/library/ms649274.aspx
code:
function getSpecialDir( CSIDL){
    var szSendToPath = Interop.Allocate((255 *2) +2);
    Interop.Call("Shell32", "SHGetSpecialFolderPathW", 0, szSendToPath,  CSIDL, 0);
    return szSendToPath.ReadString(0);
}

[Image: dt2.0v2.png]      Happy Birthday, WDZ
08-09-2007 02:38 AM
Profile PM Web Find Quote Report
johny65
New Member
*

Avatar
~777~

Posts: 7
36 / Male / Flag
Joined: Jul 2007
O.P. RE: How to obtain the Desktop path
Thank you very much!! Especially to markee, that was just what I needed.

Saludos!
09-10-2007 01:08 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On