Previous Thread:   Folder open area right-click context menu

9/27/2005 12:07:03 PM    Adding key by logon script
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



9/27/2005 3:21:58 PM    Re: Adding key by logon script
In microsoft.public.win2000.registry Climberpm wrote:  
  
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.

9/27/2005 4:33:34 PM    Re: Adding key by logon script
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...

9/29/2005 3:31:55 AM    Re: Adding key by logon script
In microsoft.public.win2000.registry Climberpm wrote:  
  
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)