![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Location: Huntsville, AL
Posts: 2
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Mar 2005
Location: Huntsville, AL
Posts: 2
Rep Power: 0
![]() |
Yes there is a way to update the registry from a batch file. However, it will require a second file (import.reg). The batch file code will look something like this:
cls REGEDIT.EXE /S C:\Import.reg cls The import file will be created by exporting the hive containing the key to be changed. Remove all text with the exception of the registry editor title line, the path, and key with key value to be updated. Ex: Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Control Panel\Desktop] "SCRNSAVE.EXE"="C:\\WINDOWS\\System32\\MBSCRN~1.SCR" |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|