Page 1 of 1 1
Topic Options
#118633 - 2004-04-27 06:51 AM Newbie for writing to registry
wizard79 Offline
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
#118634 - 2004-04-27 08:03 AM Re: Newbie for writing to registry
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Are you sure the value is REG_BINARY and not REG_DWORD ?

Please ensure the TYPE is correct. If that is not the issue then let us know and we'll review it further.

Thanks

Top
#118635 - 2004-04-27 08:24 AM Re: Newbie for writing to registry
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
to make it simpler for you, type it manually in and read with kix.
_________________________
!

download KiXnet

Top
#118636 - 2004-04-27 08:42 AM Re: Newbie for writing to registry
wizard79 Offline
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
#118637 - 2004-04-27 10:00 AM Re: Newbie for writing to registry
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so I take you didn't listen to me.
make the value in the registry by hand and make kix read it.
then make kix display it.
then copy that string to the writevalue and you have it.
_________________________
!

download KiXnet

Top
#118638 - 2004-04-27 10:11 AM Re: Newbie for writing to registry
NTDOC Administrator Offline
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 Offline
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
#118640 - 2004-07-27 01:06 AM Re: Newbie for writing to registry
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Hey mistajon,

So did you ever get this working?

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.069 seconds in which 0.035 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org