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();