Shoutbox

Change received folder location? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Change received folder location? (/showthread.php?tid=82315)

Change received folder location? by Kriogenic on 03-13-2008 at 01:50 AM

Hey there everyone

I am making a script and I want it to change the received file dir

I was just wondering if there is away to change the current "Received Files" location I looked in the documentation and saw

code:
Messenger::ReceiveFileDir
The Messenger::ReceiveFileDir property returns the path of the directory where files copied by Messenger when a file transfer request is accepted are stored.

Syntax
This is a read-only property.
[string] ReceiveFileDir;
Data Type
A string containing the full path to the directory. The path does not end with a backslash.

This property typically fails for the following reason:

The current Messenger user is not signed in.
Remarks
None.


This had lead me to believe there is no way to change the received file directory but only read its path...

So my question is...

Is there away to change the received file directory?
RE: Change received folder location? by CookieRevised on 03-13-2008 at 01:58 AM

The folder is stored in the registry as a binary unicode string. So you could change it using the windows registry APIs.

HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\FtReceiveFolder
Note that it isn't stored per user, but as a global setting for all users of Messenger.

However, changing it in the registry is not without errors either, unless you first make sure the directory actually exists. Otherwise, Messenger will produce an error when you actually recieve a file from a contact, showing that it can't properly save the file.


RE: Change received folder location? by Kriogenic on 03-13-2008 at 02:13 AM

Ohh thanks theres away to edit registry using scripts?


RE: Change received folder location? by Chris4 on 03-13-2008 at 02:23 AM

I can only find how to write and read values (from the documentation), not edit. :undecided:

quote:
The following example writes a value called "EnableOpt" in the registry and read it back.

//Write the value
var Shell = new ActiveXObject("WScript.Shell");
var ValRegPath = MsgPlus.ScriptRegPath + "EnableOpt";
Shell.RegWrite(ValRegPath, 1);

//Read the value
var EnableOpt = Shell.RegRead(ValRegPath);
Debug.Trace("EnableOpt current value: " + EnableOpt);

RE: Change received folder location? by CookieRevised on 03-13-2008 at 02:26 AM

quote:
Originally posted by Kriogenic
Ohh thanks theres away to edit registry using scripts?
yes using the Windows Registry APIs, or other methods like WMI (Windows Management Instrumentation) or the build-in Windows Script Host functions.

See various scripts for various methods (although using the Windows APIs is still the most versatile and most powerfull one)...


---------

quote:
Originally posted by Chris4
The following example writes a value called "EnableOpt" in the registry and read it back.
That really isn't the best example for this purpose, since using the build-in registry functions of the Windows Script Host are extremely limited in any thinkable way. Although it shows you "can edit" the registry somewhat, true.

But you can't use this method for something like the OP requested, since they don't support the REG_BINARY type (properly).

---------

Kriogenic, for changing that registry key you need at least:
- use the Windows Registry APIs:
      RegCreateKeyExW, RegSetValueExW, RegCloseKey (to set a binary registry key)
      RegOpenKeyExW, RegQueryValueExW, RegCloseKey (to read a binary registry key)
- use other Windows APIs (or the build-in JScript methods, although again they are very limited) to check if the new directory does exists
- use other Windows APIs (or the build-in JScript methods, although again they are very limited) to make the new directory
- use Plus! script Interop functions to call the Windows APIs
- use Plus! script Interop functions to make and allocate buffers

In other words, to pull it off in a proper way, you do need some knowledge beyond basic (Plus!) scripting.

;)
RE: Change received folder location? by Kriogenic on 03-13-2008 at 02:32 AM

alright thanks, i know its not going to work properly but it should work well enough for what i need it for :)