Editing a registry key value in a batch file

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Daniel Passwater via DotNetMonster.com (forum_at_DotNetMonster.com)
Date: 03/15/05


Date: Tue, 15 Mar 2005 15:57:54 GMT

I've built a screen saver in C#. Now I'm trying to load it and make it the
current screen saver. I found the tegistry key that needs to be changed,
but I can't seem to change it via batch file. Can soneone please help me.
Here's what I have so far.

cls

del MBScrnSvr.scr
ren MBScrnSvr.exe MBScrnSvr.scr

IF NOT EXIST c:\Windows\system32\MBScrnSvr.scr GOTO INSTALL_SCRNSVR_END
  del c:\Windows\system32\MBScrnSvr.scr
:INSTALL_SCRNSVR_END

copy MBScrnSvr.scr c:\Windows\system32\

REM Key: HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE.EXE
REM Value:C:\WINDOWS\System32\MBSCRN~1.SCR

REG QUERY RegistryPath ['HKEY_CURRENT_USER\Control\Panel\Desktop\
SCRNSAVE.EXE'] [/S] [/size] [/list]

REG UPDATE RegistryPath = C:\WINDOWS\System32\MBSCRN~1.SCR

Thanks in advance for any help.

-- 
Message posted via http://www.dotnetmonster.com