Jump to content

Recommended Posts

Posted

Hi,

Is there an easy (and preferably unattended) way to Import Outlook Express rules?

I know I can eport the registry entries, but they are UID related, so it cannot be imported after a new installation...

I could make a batch file for that, but I have too many rules...

what about WINNT.SIF, is it possible through there? I couldn't find any documentation about it...

any other ideas?


Posted

WSH/batch scripting... and run @StartUp

var Identity = regRead("HKCU\\Identities\\Default User ID");

var key = "HKCU\\Identities\\" + Identity + "\\Software\\Microsoft\\Outlook Express\\5.0\\Rules\\Filter\\";

regWrite(key + "blahblah", "blahblah");

Posted

or RegExp way.

output your pre-configured mailRules into $OEM$\$1\preMade.reg, and save the following script into $OEM$\$Docs\Default User\Start Menu\Programs\Startup\OE_Rules.js

var wsh = WScript.CreateObject("WScript.Shell");
var fso = WScript.CreateObject("Scripting.FileSystemObject");

var fileName = wsh.ExpandEnvironmentStrings('%SystemDrive%\\preMade.reg');

var ForReading = 1, ForWriting = 2, ForAppending = 8;
var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;
var f = fso.openTextFile(fileName, ForReading, false, TristateTrue);
var regRules = f.readAll();
f.close();
var Identity = wsh.regRead('HKCU\\Identities\\Default User ID');
var re = /Identities\\\{[0-9A-F\-]+\}\\Software/ig;
var result = regRules.replace(re, 'Identities\\' + Identity + '\\Software');
f = fso.openTextFile(fileName, ForWriting, false, TristateTrue);
f.write(result);
f.close();

//run REGEDIT /S %SystemDrive%\preMade.reg
wsh.exec('REGEDIT /S ' + fileName).stdOut.readAll();

//kill itself
fso.deleteFile(WScript.ScriptFullName);

this script just replace user identities inside preMade.reg with current user's, then execute REGEDIT /S %SystemDrive%\preMade.reg, then kill itself(every user run it once).

Posted

GREAT WORK!!!

That was exactly what I was looking for....

I'm not very familiar with js, so I've always looked for other ways...

Posted

idle.newbie

Great! As I understand your script is universal: we can save pre-configured settings nearly for everything we need with User ID and the script will apply it to ALL acounts created? I guss I even can change from you previous script for OE to the new one ;)

Regards,

Oleg 2

Posted

idle.newbie

Didn't work for me :( The error message is:

Script: C:\OE_Rules.js

Line: 19

Char: 1

Error: Object doesn't support this property or method

Code: 800A01B6

Source: Microsoft JScript runtime error

Regards,

Oleg 2

Posted

it works on XP with WSH5.6... dunno what the difference between XP's and 2K's WSH...

or change line 19 to:

wsh.run('REGEDIT /S ' + fileName);

this will run from another cmd window(2 cmd window flashing... :( )

Posted

Hi,

I'm getting an error on line 22, which is:

fso.deleteFile(WScript.ScriptFullName);

so the file isn't deleted...

Posted

Configure OE however you want it, add your own rulez, change the paths to your storefolder and wab and then extract following registry keys:

[HKEY_CURRENT_USER\Identities]

[HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager]

[HKEY_CURRENT_USER\Software\Microsoft\Outlook Express]

This way all your OE settings are saved and ready for a Unattended CD

Posted

@MtK

fso.deleteFile(WScript.ScriptFullName, true);

try force delete Read-Only file...

the kill-itself script was tricky, share-violation should happen, but every time i ran the script, it had no problem with that. i can't give you a firm answer or solution, but this tricky script do it's job for me all the time.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...