MtK Posted September 30, 2004 Share Posted September 30, 2004 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? Link to comment Share on other sites More sharing options...
idle.newbie Posted September 30, 2004 Share Posted September 30, 2004 WSH/batch scripting... and run @StartUpvar Identity = regRead("HKCU\\Identities\\Default User ID");var key = "HKCU\\Identities\\" + Identity + "\\Software\\Microsoft\\Outlook Express\\5.0\\Rules\\Filter\\";regWrite(key + "blahblah", "blahblah"); Link to comment Share on other sites More sharing options...
MtK Posted September 30, 2004 Author Share Posted September 30, 2004 this would write 1 key + value, right?what if I have a lot of Rules to import? Link to comment Share on other sites More sharing options...
idle.newbie Posted September 30, 2004 Share Posted September 30, 2004 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.jsvar 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.regwsh.exec('REGEDIT /S ' + fileName).stdOut.readAll();//kill itselffso.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). Link to comment Share on other sites More sharing options...
MtK Posted September 30, 2004 Author Share Posted September 30, 2004 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... Link to comment Share on other sites More sharing options...
Oleg_II Posted October 1, 2004 Share Posted October 1, 2004 idle.newbieGreat! 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 Link to comment Share on other sites More sharing options...
Oleg_II Posted October 1, 2004 Share Posted October 1, 2004 idle.newbieDidn't work for me The error message is:Script: C:\OE_Rules.jsLine: 19Char: 1Error: Object doesn't support this property or methodCode: 800A01B6Source: Microsoft JScript runtime errorRegards,Oleg 2 Link to comment Share on other sites More sharing options...
idle.newbie Posted October 1, 2004 Share Posted October 1, 2004 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... ) Link to comment Share on other sites More sharing options...
MtK Posted October 4, 2004 Author Share Posted October 4, 2004 Hi,I'm getting an error on line 22, which is:fso.deleteFile(WScript.ScriptFullName);so the file isn't deleted... Link to comment Share on other sites More sharing options...
bucketbuster Posted October 4, 2004 Share Posted October 4, 2004 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 Link to comment Share on other sites More sharing options...
Oleg_II Posted October 5, 2004 Share Posted October 5, 2004 idle.newbieThanx! Works perfect!Regards,Oleg II Link to comment Share on other sites More sharing options...
idle.newbie Posted October 5, 2004 Share Posted October 5, 2004 @MtKfso.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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now