#118633 - 2004-04-27 06:51 AM
Newbie for writing to registry
|
wizard79
Getting the hang of it
Registered: 2003-03-26
Posts: 64
Loc: Australia.
|
I need to use kix to add this to the registry (for adding a password to pop email)
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "POP3 Password2", "hex:01,02,47,00,72,00,61,00,64,00,65,00,20,00,35,00,63,00,31,00,36,00,39,00,36,00,37,00,30,00,36,00,30,00,00,00", "REG_BINARY")
The value is meant to be for example 1542 but in hex binary But for some reason its different in the registry, something like "0e 0e etc etc" not what I want. What am I doing wrong?
|
|
Top
|
|
|
|
#118636 - 2004-04-27 08:42 AM
Re: Newbie for writing to registry
|
wizard79
Getting the hang of it
Registered: 2003-03-26
Posts: 64
Loc: Australia.
|
Yes definately reg_binary I did it manually in registry
This is what it looks like once exported in WInXP
[code]
[HKEY_CURRENT_USER\Software\Microsoft\internet account manager\accounts\5c]
"POP3 Password2"=hex:01,02,47,00,72,00,61,00,64,00,65,00,20,00,35,00,63,00,31,\
00,36,00,39,00,36,00,37,00,30,00,36,00,30,00,00,00
[/code]
It is coming out like this once the kix script has been run: (whilst checking regedit)
[code]
POP3 Password2 REG_BINARY 0e 0e 01 01 20 47 47 00 72 etc etc...
[/code]
Edited by mistajon (2004-04-27 08:52 AM)
|
|
Top
|
|
|
|
#118638 - 2004-04-27 10:11 AM
Re: Newbie for writing to registry
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Here is some example code
Code:
Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
Dim $RC,$CV,$WantedVal
$WantedVal='010247007200610064006500200035006300310036003900360037003000360030000000'
$CV=ReadValue('HKCU\Software\Microsoft\Internet Account Manager\Accounts\5c', 'POP3 Password2')
'Current Value is: ' + $CV ?
$RC=WriteValue('HKCU\Software\Microsoft\Internet Account Manager\Accounts\5c', 'POP3 Password2',$WantedVal,'REG_BINARY')
$CV=ReadValue('HKCU\Software\Microsoft\Internet Account Manager\Accounts\5c', 'POP3 Password2')
'Updated Value is: ' + $CV ?
If you want to modify certain offset values then review this code and adapt for your needs.
Code:
Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')
SetTaskManager('hide')
Function SetTaskManager($Flag)
Dim $Settings,$Count,$i,$x
$Flag = IIF($Flag='hide','67','47')
$Settings = ReadValue('HKCU\Software\Microsoft\Windows NT\CurrentVersion\TaskManager', 'Preferences')
Dim $Regstring[(Len($Settings)/2)-1]
For $i = 1 To Len($Settings) Step 2
$Regstring[$Count] = SubStr($Settings,$i,2)
$Count = $Count + 1
Next
$Regstring[652]=$Flag
$x = WriteValue('HKCU\Software\Microsoft\Windows NT\CurrentVersion\TaskManager', 'Preferences',Join($Regstring,""),'REG_BINARY')
EndFunction
For a little more information on the bottom code please review this link here
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Number=116006
|
|
Top
|
|
|
|
#118639 - 2004-04-27 12:32 PM
Re: Newbie for writing to registry
|
wizard79
Getting the hang of it
Registered: 2003-03-26
Posts: 64
Loc: Australia.
|
Thanks for the code! Much appreciated.
Hmm I will test it out. With my prior code I cant get Outlook Express to stop asking for the password. It pops up asking for a password with a blank white little window. I will post my code asap.
My code is similar to this (my older version of code):
Code:
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "POP3 Server", "mail.xxxxxxxxx.com", "REG_SZ")
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "SMTP Server", "mail.xxxxxxxxxx.com", "REG_SZ")
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "POP3 Password2", "010247007200610064006500200035004600320044004600310032003700320030000000", "REG_BINARY")
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "POP3 User Name", "$bpsgrade@xxxxx.com", "REG_SZ")
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "SMTP Display Name", "Grade $bpsgrade", "REG_SZ")
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "SMTP Email Address", "$bpsgrade@xxxx.xxxx.com", "REG_SZ")
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "SMTP Organization Name", "xxxxxx Organisation", "REG_SZ")
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "Account Name", "Grade $bpsgrade", "REG_SZ")
$RC = WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\$bpsgrade", "POP3 Prompt for Password", "0", "REG_DWORD")
The password part in reg is indentical to what occurs if I manually put in the password. I dont understand it. (ie: if I manually put password in it accepts it and remembers from then onwards with the same reg key as above (binary))
Edited by mistajon (2004-04-27 12:36 PM)
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|