PC Review


Reply
Thread Tools Rate Thread

Adding key by logon script

 
 
Climberpm
Guest
Posts: n/a
 
      27th Sep 2005
I'm having a problem adding a registry key by logon script. Actually the
key adds OK but it just adds the wrong value.

The script loads a .reg file however it doesn't replace the %USERNAME%
variable with the actual username but instead uses USERNAME. So I end up
with a folder named "%USERNAME% and not "jdoe"

Here is the content of the .reg file, which I load from the script by the
"regedit /s loadkey.reg" command

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Creative Solutions\Practice Management]
"LocalPath"="n:\\wincsi.net\\ps\\%USERNAME%"

Any thoughts ?

Thanks

Paul



 
Reply With Quote
 
 
 
 
Mark V
Guest
Posts: n/a
 
      27th Sep 2005
In microsoft.public.win2000.registry Climberpm wrote:

> I'm having a problem adding a registry key by logon script.
> Actually the key adds OK but it just adds the wrong value.
>
> The script loads a .reg file however it doesn't replace the
> %USERNAME% variable with the actual username but instead uses
> USERNAME. So I end up with a folder named "%USERNAME% and not
> "jdoe"
>
> Here is the content of the .reg file, which I load from the
> script by the "regedit /s loadkey.reg" command
>
> Windows Registry Editor Version 5.00
>
> [HKEY_CURRENT_USER\Software\Creative Solutions\Practice
> Management] "LocalPath"="n:\\wincsi.net\\ps\\%USERNAME%"
>
> Any thoughts ?


To get variables to be resolved, the value's Type must be
REG_EXPAND_SZ (Expand String). As REG_SZ the %USERNAME% is treated
literally.

Consider REG.EXE MS Tool perhaps.

 
Reply With Quote
 
Climberpm
Guest
Posts: n/a
 
      28th Sep 2005
Thanks Mark, I'll give that a try. I tried manually changing the variable
and it didn't produce the expected results with the application so I'm
waiting to hear back from them. If it doesn't work with a manual edit the
script won't doing anything even if I can find the right context/tool.

Paul




"Mark V" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In microsoft.public.win2000.registry Climberpm wrote:
>
>> I'm having a problem adding a registry key by logon script.
>> Actually the key adds OK but it just adds the wrong value.
>>
>> The script loads a .reg file however it doesn't replace the
>> %USERNAME% variable with the actual username but instead uses
>> USERNAME. So I end up with a folder named "%USERNAME% and not
>> "jdoe"
>>
>> Here is the content of the .reg file, which I load from the
>> script by the "regedit /s loadkey.reg" command
>>
>> Windows Registry Editor Version 5.00
>>
>> [HKEY_CURRENT_USER\Software\Creative Solutions\Practice
>> Management] "LocalPath"="n:\\wincsi.net\\ps\\%USERNAME%"
>>
>> Any thoughts ?

>
> To get variables to be resolved, the value's Type must be
> REG_EXPAND_SZ (Expand String). As REG_SZ the %USERNAME% is treated
> literally.
>
> Consider REG.EXE MS Tool perhaps.
>



 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      29th Sep 2005
In microsoft.public.win2000.registry Climberpm wrote:

> Thanks Mark, I'll give that a try. I tried manually changing
> the variable and it didn't produce the expected results with the
> application so I'm waiting to hear back from them. If it
> doesn't work with a manual edit the script won't doing anything
> even if I can find the right context/tool.


It seems possible that the application is reading the value
directly and was not written to use or understand REG_EZPAND_SZ
types.
? (pure guess)

>
> "Mark V" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> In microsoft.public.win2000.registry Climberpm wrote:
>>
>>> I'm having a problem adding a registry key by logon script.
>>> Actually the key adds OK but it just adds the wrong value.
>>>
>>> The script loads a .reg file however it doesn't replace the
>>> %USERNAME% variable with the actual username but instead uses
>>> USERNAME. So I end up with a folder named "%USERNAME% and not
>>> "jdoe"
>>>
>>> Here is the content of the .reg file, which I load from the
>>> script by the "regedit /s loadkey.reg" command
>>>
>>> Windows Registry Editor Version 5.00
>>>
>>> [HKEY_CURRENT_USER\Software\Creative Solutions\Practice
>>> Management] "LocalPath"="n:\\wincsi.net\\ps\\%USERNAME%"
>>>
>>> Any thoughts ?

>>
>> To get variables to be resolved, the value's Type must be
>> REG_EXPAND_SZ (Expand String). As REG_SZ the %USERNAME% is
>> treated literally.
>>
>> Consider REG.EXE MS Tool perhaps.
>>

>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling webpage with logon script, logon script wont close gerryR Microsoft Windows 2000 CMD Promt 16 6th Nov 2009 05:19 PM
logon script adding printers and account tracking code Tripp Microsoft Windows 2000 Printing 1 20th Jan 2008 12:40 PM
Automatically adding PST files to Outlook profile via logon script Brian Steele Microsoft Outlook Installation 2 17th Mar 2006 12:39 PM
Adding Printers via logon script =?Utf-8?B?U3ByaW5nc2lkZQ==?= Microsoft Windows 2000 Group Policy 4 10th Mar 2005 03:45 PM
Adding Printers via Logon Script =?Utf-8?B?U3ByaW5nc2lkZQ==?= Microsoft Windows 2000 Active Directory 1 9th Mar 2005 04:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:40 AM.