Page 1 of 2 12>
Topic Options
#25955 - 2002-07-26 06:06 PM MS Outlook Registry Change
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
Okay. Here goes.

In my logon scrip for NT machines, I want to change an Outlook setting for a certain group of users in our company. Since I am lazy, I want to use the script to change their reply-to address in their outlook account by changing the resigstry string that is responsible.

So far this is the portion I am working on. My question is; How do I concatenate the user name with the "@companyname.com" section of their e-mail address in the registry??

Is this right?, or am I out to lunch?
__________________________________________

IF INGROUP ("Accounting")
SELECT
CASE ($NT_mode = "yes")
WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Outlook\OMI Account Manager\Accounts\00000001", "SMTP Reply To Email Address", "@userid@companyname.com", "REG_BINARY")

Top
#25956 - 2002-07-26 06:37 PM Re: MS Outlook Registry Change
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Try:
code:
IF INGROUP ("Accounting")
SELECT
CASE ($NT_mode = 'yes')
$rc=WriteValue ('HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Outlook\OMI Account Manager\Accounts\00000001',
'SMTP Reply To Email Address', @userid+'@@companyname.com', 'REG_BINARY')
ENDSELECT
ENDIF

Are you sure about the REG_BINARY part? Then you might need to provide the value in REG_BINARY format and not plain text format. That means you'll have to convert the value into it's corresponding hex values and possibly even convert to UNICODE.

[ 26 July 2002, 18:38: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#25957 - 2002-07-26 06:44 PM Re: MS Outlook Registry Change
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
I know the REG_BINARY part is wrong because it is a string that I have to modify.
Top
#25958 - 2002-07-26 06:46 PM Re: MS Outlook Registry Change
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
So, what format is the registry value? REG_BINARY or REG_SZ? You will need to use the correct format though.
_________________________
There are two types of vessels, submarines and targets.

Top
#25959 - 2002-07-26 06:46 PM Re: MS Outlook Registry Change
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
On that note...REG_STRING???

I know that doesn't exist, but what is the REG_* command for a string edit?

Top
#25960 - 2002-07-26 06:47 PM Re: MS Outlook Registry Change
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
if it's binary, try putting just 1 in it...
_________________________
!

download KiXnet

Top
#25961 - 2002-07-26 06:48 PM Re: MS Outlook Registry Change
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
It is a string...REG_SZ??
Top
#25962 - 2002-07-26 06:52 PM Re: MS Outlook Registry Change
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
string is REG_SZ [Big Grin]
_________________________
!

download KiXnet

Top
#25963 - 2002-07-26 07:03 PM Re: MS Outlook Registry Change
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
Okay folks...how does it look?
-------------------------------------
IF INGROUP ("accounting")
SELECT
CASE ($NT_mode = "yes")
WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Outlook\OMI Account Manager\Accounts\00000001", "SMTP Reply To Email Address", @userid+"@companyname.com", "REG_SZ")

END SELECT
END IF

Top
#25964 - 2002-07-26 07:05 PM Re: MS Outlook Registry Change
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
here is a routine that will take a string and convert it into a reg_binary format

code:
$label="string to convert"
for $loop = 1 to len($label) ; ******* parse the label and convert to hex string
$hexchar=dectohex(asc(substr("$label",$loop,1)))
$hexlabel=$hexlabel+$hexchar+"00"
next
while len($hexlabel) < 128 ; ******* Buffer the hex string to 128 characters
$hexlabel=$hexlabel+"00"
loop

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#25965 - 2002-07-26 07:07 PM Re: MS Outlook Registry Change
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
endselect and endif are supposed to be 1 word (each)

btw.. if you do not want a lot of zeros (0) showing up in your console window, put a variable in front of your writevalue statement

$rc=writevalue...

[ 26 July 2002, 19:09: Message edited by: Radimus ]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#25966 - 2002-07-26 07:08 PM Re: MS Outlook Registry Change
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
[Big Grin] RAD catches another VB'r [Big Grin]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#25967 - 2002-07-26 07:08 PM Re: MS Outlook Registry Change
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You still need to double up the '@' and you can use REGEDIT and REGEDT32 to check what type the registry value is. You must use the correct registry type, otherwise the value might not be read correctly. Check the KiXtart Manual page 26 on how to use '@', '$', and '%' in a string.
_________________________
There are two types of vessels, submarines and targets.

Top
#25968 - 2002-07-26 10:57 PM Re: MS Outlook Registry Change
ITDEPT Offline
Fresh Scripter

Registered: 2002-06-11
Posts: 26
Loc: Edmonton, Alberta, Canada
Something is wrong, all the script does is beep at me. I HATE THAT!!!

I suspect it is the registry key-type. It is a string, not binary or dword. Right now I'm using REG_SZ and all it will do is beep, it doesn't change a darn thing in the registry...

Top
#25969 - 2002-07-26 10:59 PM Re: MS Outlook Registry Change
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Use the @ERROR macro to trace potential errors in your code.
_________________________
There are two types of vessels, submarines and targets.

Top
#25970 - 2002-07-26 11:31 PM Re: MS Outlook Registry Change
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the beep is probably a major error which makes the script to end.

so, what you need to do is start the script with /d switch to see what line is has the error.

what I suspect is just simple syntax error
_________________________
!

download KiXnet

Top
#25971 - 2002-07-26 11:34 PM Re: MS Outlook Registry Change
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Spark up a DOS box and run it from there. The message will stay on the DOS box.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#25972 - 2002-07-26 11:37 PM Re: MS Outlook Registry Change
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
les, that is if he uses the console version...
_________________________
!

download KiXnet

Top
#25973 - 2002-07-26 11:39 PM Re: MS Outlook Registry Change
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well... he doesn't capture return codes so figure he's getting a console. [Razz]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#25974 - 2002-07-26 11:43 PM Re: MS Outlook Registry Change
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sure,
but if he uses wkix the console it produces gets closed when wkix encounters an error.

with normal old style kix it uses the same window.
_________________________
!

download KiXnet

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 1110 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.073 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

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