EEK2
asked on
Replace Registry (REG_SZ) keys at first login with current OS name?
Hello,
I need to have a script run (at first login) after a new OS is built that does the following:
1) Delete the following two REG_SZ keys (located here):
HKLM\Software\VERITAS\NetB ackup\Curr entVersion \Config
Keys are:
'Browser' and
'Client_Name'
^^ These two keys contain a text value for the 'old' pre-image OS name
2) I then need to re-add these keys with the 'new' current system (OS) name (guessing by passing in %COMPUTERNAME% somehow)?
If there is a way to replace the current value of these keys instead of deleting / re-adding that works as well.
Operating Systems this will be used on:
Windows 2003 Server Standard (32-bit and 64-bit)
Windows 2003 Server Enterprise (32-bit and 64-bit)
Thank you in advance!!
I need to have a script run (at first login) after a new OS is built that does the following:
1) Delete the following two REG_SZ keys (located here):
HKLM\Software\VERITAS\NetB
Keys are:
'Browser' and
'Client_Name'
^^ These two keys contain a text value for the 'old' pre-image OS name
2) I then need to re-add these keys with the 'new' current system (OS) name (guessing by passing in %COMPUTERNAME% somehow)?
If there is a way to replace the current value of these keys instead of deleting / re-adding that works as well.
Operating Systems this will be used on:
Windows 2003 Server Standard (32-bit and 64-bit)
Windows 2003 Server Enterprise (32-bit and 64-bit)
Thank you in advance!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect solutions, Canali -- thank you very much.
In terms of the two different options -- would you recommend one as being more resilient than another (i.e. more portable between W2K and W2K3) or is it a wash?
I personally liked the last one because it seemed to achieve the result with less complexity...
Thanks, again.
In terms of the two different options -- would you recommend one as being more resilient than another (i.e. more portable between W2K and W2K3) or is it a wash?
I personally liked the last one because it seemed to achieve the result with less complexity...
Thanks, again.
@echo off
setlocal
set w=echo.^>^>%temp%\delreg.t
if exist %temp%\delreg.tmp del %temp%\delreg.tmp
::registry file creation
%w% Windows Registry Editor Version 5.00
%w%
%w% [HKEY_LOCAL_MACHINE\Softwa
%w% "Browser"=-
%w% "Client_Name"=-
regedit /s %temp%\delreg.tmp
::end delreg.cmd
:: *** setreg.cmd
@echo off
setlocal
set w=echo.^>^>%temp%\setreg.t
if exist %temp%\setreg.tmp del %temp%\setreg.tmp
::registry file creation
%w% Windows Registry Editor Version 5.00
%w%
%w% [HKEY_LOCAL_MACHINE\Softwa
%w% "Browser"="%COMPUTERNAME%"
%w% "Client_Name"="%COMPUTERNA
regedit /s %temp%\setreg.tmp
::end setreg.cmd