[Solved]Add / merge a registry file?

You need help to start using UVK? You have a doubt on a UVK feature? Post here!
Forum rules
We have no special rules for UVK forums. Just try to be polite and clear in your posts.
Please don't post spam in this forum. Spammers will be banned by IP, e-mail and username.
We reserve the right to delete all posts and ban all users we consider not having respected these rules without warning.
Post Reply
netmonk99
Posts: 13
Joined: Tue May 29, 2012 6:44 am

[Solved]Add / merge a registry file?

Post by netmonk99 »

In UVK, is there any way to "execute" a registry file so that it's contents are merged into the current registry? As part of an optimization strategy, I like to add the TimeToKill registry hack that forces all programs to end in 5 seconds after the user clicks shutdown/restart.

Also, is it possible to do this silently, so that I won't have to click "yes" to add to registry?

Thanks!
Fred
Site Admin
Posts: 2357
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Add / merge a registry file?

Post by Fred »

Hi netmonk99.

Sure, you can do most everything with a UVK script. In fact, you have several ways to write registry values using UVK.

Method 1, Using the <Reg> UVK command:

Code: Select all

 <Reg>

[HKEY_CURRENT_USER\Control Panel\Desktop]
"AutoEndTasks"=dword:00000001
"WaitToKillAppTimeout"=dword:00001388
Method 2, using regedit to import the reg file:

Code: Select all

 <RunWait>
%WinDir%\regedit.exe /s "Path of reg file"
Replace Path of reg file with the path to the reg file you want to merge. The /s switch tells regedit to do it silently.

Method 3, Using the Reg Import cmd command:

Code: Select all

 <CmdScript>
@echo off
Reg import "Path to reg file"
Again, replace Path of reg file with the path to the reg file you want to import.

Method 4, Using the Reg Add cmd command:

Code: Select all

 <CmdScript>
@echo off
Reg Add "HKCU\Control Panel\Desktop" /v AutoEndTasks /t REG_DWORD /d 1 /f
Reg Add "HKCU\Control Panel\Desktop" /v WaitToKillAppTimeout /t REG_DWORD /d 5000 /f
Hope it helps.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Fred
Site Admin
Posts: 2357
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Add / merge a registry file?

Post by Fred »

I forgot to mention that if you're using the UVK immunization, you must un-immunize the Desktop registry entries section before running the script.

Also, if you change these registry entries, be sure to save all open documents before log off/shutdown, or you may not have enough time to do it.

The regedit code I provided was just an example, you can add the code you want.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
netmonk99
Posts: 13
Joined: Tue May 29, 2012 6:44 am

Re: Add / merge a registry file?

Post by netmonk99 »

I can't thank you enough for this, Fred. You and your software are truly great!
Alanna
Posts: 1
Joined: Wed Jun 19, 2013 1:12 pm

Re: [Solved]Add / merge a registry file?

Post by Alanna »

The Windows Registry is a hierarchical database that stores pattern settings and options on Microsoft Windows operating systems. It contains settings for low-level in service system components and for application running on the platform that have opted to use the registry.
Post Reply