Climberpm
09-27-2005, 08:07 PM
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
Mark V
09-27-2005, 08:21 PM
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.
Climberpm
09-28-2005, 12:33 AM
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" <notvalid@nul.invalid> wrote in message
news:Xns96DE9C505BB52z9zzaQ2btw@msnews.microsoft.com...
> 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.
>
Mark V
09-29-2005, 08:31 AM
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" <notvalid@nul.invalid> wrote in message
> news:Xns96DE9C505BB52z9zzaQ2btw@msnews.microsoft.com...
>> 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.
>>
>
>
>