Welcome Guest Search | Active Topics | Members | Log In | Register

Send To-Email Recip Workaround for XP x64 Options · View
MarkM
Posted: Wednesday, July 09, 2008 8:12:12 PM

Rank: Technical Staff
Groups: Member

Joined: 7/9/2008
Posts: 1
Points: 3
Location: Nipomo
XP x64 is pretty damn cool, but there is still much left undone. One of them is Send To->Email Recip -- it doesn't use Outlook to create the email, because Office is still 32 bit. OE that ships with XP x64 is a 64 bit extension, and it's the only game in town.

If you run %windir%\SysWOW64\explorer.exe, the Sent To thing works from there -- but that isn't always real fucking convenient now, is it? So I wrote this script, it doesn't actually fix the problem, it merely adds an equivilent menu item for sll files.

Create this script wherever you want it to live, then execute it with the /register:yes argument. That will add it to your Explorer. Enjoy...

Code:

var hdr = new Array(
"         Script: SendToMailRecip.js",
"        Purpose: Work-around MS lameness ",
"                 re: Send to -> Mail Recip shell functionality on XP x64",
"         Author: Mark J. McGinty (mmcginty@thinkset.com)",
"           Date: 08 July 2008",
" IP Declaration: Copyright (c) Mark J. McGinty 2008, All Rights Reserved",
"    Permissions: Granted to public domain: permission to use and/or distribute,",
"                 provided this header is left intact"
);


var usage = new Array(
"",
"Usage:",
"       To register this script (using its current location) as a shell ",
"       extension for all files, execute the following command:",
"",
"            SendToMailRecip.js /register:yes",
"",
"       To unregister, execute the following command:",
"",
"            SendToMailRecip.js /register:no"
);

var keyName = "HKCR\\*\\shell\\Send via Email\\";



var reg = WScript.Arguments.Named("register");
if (reg != null)
{
    WScript.Echo(hdr.join("\r\n"));
    try {
        var oShell = WScript.CreateObject("WScript.Shell");
        var tmp = "";
        if (reg.toUpperCase() == "NO")
        {
            oShell.RegDelete(keyName + "command\\");
            oShell.RegDelete(keyName);
            tmp = "Un";
        }
        else
            oShell.RegWrite(keyName + "command\\", "wscript.exe \"" + WScript.ScriptFullName + "\" /file:\"%1\"");
        WScript.Echo("SendToMailRecip: " + tmp + "Registration succeeded!");
    } catch(e) {
        WScript.Echo("SendToMailRecip: " + tmp + "Registration failed. (You may lack sufficient permissions.) \r\n" +
            "Error: " + e.description);
    }

    WScript.Quit();
}


var fullPath = WScript.Arguments.Named("file");
if (fullPath != null)
{
    var olMailItem = 0;
    var a = fullPath.split("\\");
    var fileName = a[a.length - 1];
    var oOutlook = new ActiveXObject("Outlook.Application");
    var oItem = oOutlook.CreateItem(olMailItem);
    oItem.Attachments.Add(fullPath);
    oItem.Subject = "Emailing file: " + fileName;
    oItem.Body = "See attached file: " + fileName + "\r\n\r\n(If in doubt, contact the sender before opening the attachment.)" +
            "\r\n\r\n\r\nEvolve your PC Platform: Make XP x64 work for you!"
    oItem.Save();
    oItem.Display();

    WScript.Quit();
}



WScript.Echo(hdr.join("\r\n"));
WScript.Echo(usage.join("\r\n"));
WScript.Quit();

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Altered by Mark McGinty Based on the FlatEarth Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.125 seconds.