Page 1 of 1

import Outlook Express 6 "Internet-Accounts"

Posted: 25 Jul 2013 07:02
by Ed Dyreen
Hi guys,

I'm looking for a way to import Internet-Accounts into winXP Outlook Express 6.

Importing mails was easy, just copy all the .dbx files
Address Book too, just copy the .wab file

But the account ? I can export/import it as a .iaf file, but wouldn't know how to script it.

I'll look to see if there are any WMI objects I can find, worst case scenario will be automating the GUI :(

Re: import Outlook Express 6 "Internet-Accounts"

Posted: 25 Jul 2013 10:38
by penpen
The Outlook Express 6 Settings are located in the registry key:
HKCU\Software\Microsoft\Internet Account Manager\

And the accounts should be in:
HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000001
HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000002
HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000003
...

Export them using:

Code: Select all

reg.exe export "HKCU\Software\Microsoft\Internet Account Manager" "Internet Account Manager.reg"

reg.exe export "HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000001" "Account 1.reg"
reg.exe export "HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000002" "Account 2.reg"
reg.exe export "HKCU\Software\Microsoft\Internet Account Manager\Accounts\00000003" "Account 3.reg"
:: ...

penpen

Re: import Outlook Express 6 "Internet-Accounts"

Posted: 26 Jul 2013 16:44
by Ed Dyreen
Ok thanks.

One problem though, when I use reg.EXE export all key values are in hex.

Any way to export in text ?

Code: Select all

"Store Root"=%UserProfile%...
instead of
"Store Root"=hex(2):25,00...

Re: import Outlook Express 6 "Internet-Accounts"

Posted: 27 Jul 2013 15:56
by penpen
I think, there is no way to export registry values of type REG_BINARY as ASCII.
But you may parse it somehow like this to ASCII after you have exported it:

Code: Select all

@echo off
setlocal
set ASCII=                  ^^^                                               ^^^ ^^^!^^^"^^^#^^^$%%%%^^^&^^^'^^^(^^^)^^^*^^^+^^^,^^^-^^^.^^^/^^^0^^^1^^^2^^^3^^^4^^^5^^^6^^^7^^^8^^^9^^^:^^^;^^^<^^^=^^^>^^^?^^^@^^^A^^^B^^^C^^^D^^^E^^^F^^^G^^^H^^^I^^^J^^^K^^^L^^^M^^^N^^^O^^^P^^^Q^^^R^^^S^^^T^^^U^^^V^^^W^^^X^^^Y^^^Z^^^[^^^\^^^]^^^^^^^_^^^`^^^a^^^b^^^c^^^d^^^e^^^f^^^g^^^h^^^i^^^j^^^k^^^l^^^m^^^n^^^o^^^p^^^q^^^r^^^s^^^t^^^u^^^v^^^w^^^x^^^y^^^z^^^{^^^|^^^}^^^~                                                                    ^^^¡^^^¢^^^£^^^¤^^^¥^^^¦^^^§^^^¨^^^©^^^ª^^^«^^^¬^^^­^^^®^^^¯^^^°^^^±^^^²^^^³^^^´^^^µ^^^¶^^^·^^^¸^^^¹^^^º^^^»^^^¼^^^½^^^¾^^^¿^^^À^^^Á^^^Â^^^Ã^^^Ä^^^Å^^^Æ^^^Ç^^^È^^^É^^^Ê^^^Ë^^^Ì^^^Í^^^Î^^^Ï^^^Ð^^^Ñ^^^Ò^^^Ó^^^Ô^^^Õ^^^Ö^^^×^^^Ø^^^Ù^^^Ú^^^Û^^^Ü^^^Ý^^^Þ^^^ß^^^à^^^á^^^â^^^ã^^^ä^^^å^^^æ^^^ç^^^è^^^é^^^ê^^^ë^^^ì^^^í^^^î^^^ï^^^ð^^^ñ^^^ò^^^ó^^^ô^^^õ^^^ö^^^÷^^^ø^^^ù^^^ú^^^û^^^ü^^^ý^^^þ^^^ÿ
setlocal enableDelayedExpansion
set "I="
set "check="
set "char="
set "errors=false"
set "unicodeHexString=01 02 00 40 00 41 00 42 00 43"

set /P "=Parsing %unicodeHexString% to ASCII: " < nul
for %%a in (%unicodeHexString%) do (
   set /A "I=0x%%a<<1"
   for %%b in (!I!) do set "check=!ASCII:~%%b,1!"
   set /A "I+=1"
   for %%b in (!I!) do set "char=!ASCII:~%%b,1!"
   if "!check!" == " " (
      set "errors=true"
   ) else (
      (set /P ="!char!") < nul
   )
)

echo(
if "%errors%" == "true" (
   echo There may be errors on parsing the string to ascii.
   echo But it may also unicode: RegExp ^(0x01 0x02^) ^(0x00 0xXX^)*
)

goto :eof
But if you want to restore it to another registry using import, the unchanged *.reg file would be of more use.
Additionally not all registry values of type REG_BINARY are coded ASCII Strings.

penpen

Edited: Corrected some errors.

Re: import Outlook Express 6 "Internet-Accounts"

Posted: 28 Jul 2013 16:22
by Ed Dyreen
penpen wrote:I think, there is no way to export registry values of type REG_BINARY as ASCII.
When I manually export the keys ( regedit.EXE ) I get "Store Root" in ASCII. I'd prefer ASCII as I need to verify and optionally change the "Store Root" key before importing it on the new system.
penpen wrote:Additionally not all registry values of type REG_BINARY are coded ASCII Strings.
That's ok, the only key I'd like to change is "Store Root" which is a REG_EXPAND_SZ
As your code suggest converting HEX to ASCII is going to be a hassle.
Too bad regedit.EXE only supports exporting the key's in ASCII interactively.