Page 1 of 1 1
Topic Options
#124588 - 2004-08-06 11:26 PM Registry key
BlackStar Offline
Lurker

Registered: 2004-05-19
Posts: 3
I'm trying to copy Outlook signature files from the local machine to the Terminal Server, and so once the files are copied the signatures will be automatically enabled in Outlook.
I created a script to copy the signature files. Does anybody know how can I copy the registry value?
That code gets the value on the local machine, how can I get it on the Terminal Server?
dim $var
$var=ReadValue('HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\MailSettings','NewSignature')
$var
return
If anybody has another ideas please share the knowledge.
Thanks

Top
#124589 - 2004-08-07 12:11 AM Re: Registry key
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Within the context of a logon script, they are both considered local. When you logon to the TS, the script runs on the TS in the security context of the current user so HKCU will be the user's local reg hive on the TS.

What you should do is to setup an INI file that you can use to pass the value from the local logon at the client to the local logon at the TS.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#124590 - 2004-08-12 12:51 AM Re: Registry key
BlackStar Offline
Lurker

Registered: 2004-05-19
Posts: 3
Could you give me any tips on setting up the ini file
Top
#124591 - 2004-08-12 03:03 PM Re: Registry key
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Setting up the INI is a braindead simple one liner. Something like this:
(untested)
Code:
break on
$INI = 'O:\HKCU.INI' ;this should be a network homeshare accessible from both the client and the TS
if ProductSuite("Terminal Server") and not ProductSuite("Single User Terminal Server")
$value = ReadProfileString($INI,'MailSettings','NewSignature')
$RC = WriteValue('HKCU\Software\Microsoft\Office\10.0\Common\MailSettings','NewSignature',$value)
Else
$value = ReadValue('HKCU\Software\Microsoft\Office\10.0\Common\MailSettings','NewSignature')
$RC = WriteProfileString($INI,'MailSettings','NewSignature',$value)
EndIf
Function ProductSuite ($Product)
Dim $Product
select
case $Product = "None" $x=0
case $Product = "Small Business" $x=1
case $Product = "Enterprise" $x=2
case $Product = "BackOffice" $x=4
case $Product = "CommunicationServer" $x=8
case $Product = "Terminal Server" $x=16
case $Product = "Small Business (Restricted)" $x=32
case $Product = "Embedded NT" $x=64
case $Product = "DataCenter" $x=128
case $Product = "Single User Terminal Server" $x=256
case $Product = "Home Edition" $x=512
case $Product = "Blade Server" $x=1024
case 1 $RC=MessageBox ("Invalid parameter used in function ProductSuite ($Product)",48)
endselect
$ProductSuite = $x & val(@ProductSuite)
Endfunction

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 765 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.092 seconds in which 0.063 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