View Single Post
Old Mar 15th, 2005, 11:18 AM   #1
dpasswat
Newbie
 
Join Date: Mar 2005
Location: Huntsville, AL
Posts: 2
Rep Power: 0 dpasswat is on a distinguished road
Update registry key value via batch file

I've written a screen saver, and I'm trying to make it the current screen with a batch file. I can do all of the file stuff, but I'm having trouble updating the registry. BTW: I am in admin mode. My code 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  Key value: C:\WINDOWS\System32\MBSCRN~1.SCR

HKEY_CURRENT_USER\Control Panel\Desktop "SCRNSAVE.EXE" = -

HKEY_CURRENT_USER\Control Panel\Desktop "SCRNSAVE.EXE" = -s C:\WINDOWS\System32\MBSCRN~1.SCR

Thanks.
dpasswat is offline   Reply With Quote