Giter Club home page Giter Club logo

regln's Introduction

REGLN - Windows Rregistry Linking Utility, v2.2

Copyright (c) 1999, Antoni Sawicki

Downloads

See Releases

Usage instructions

  Usage: regln [-v] <link_key>  <target_key>
         regln  -d  <link_key>

  <link_key> is the new registry link key
  <target_key> is an existing registry key being linked to
  -v = volatile, exist in memory only
  -d = delete link

Regln can either create or delete a registry link.

To create a registry link you need to have an existing registry key to link to and decide whenever the link has to be volatile or permanent.

Volatile links will be stored in the RAM memory and will not be saved in any HIVE file. This is usefull for experimenting because a simple reboot will remove the link. If you don't specify "-v" option the link will be created permanently by default. This is potentially dangerous operation.

The application uses NT Namespace Paths by default, eg:

  \Registry\Machine\Software\Microsoft

You can see and understand NT Namespace Paths by looking at HKLM\SYSTEM\CurrentControlSet\Control\hivelist key.

However for compatibility and ease of use, a conversion function to translate to Win32 key names was implemented in the public release. From now on, you can simply use:

  HKEY_LOCAL_MACHINE\Software\Microsoft

or:

  HKLM\Software\Microsoft

Unfortunately the "virtual root keys" like HKEY_CURRENT_USER and others are only Win32 addition and are not visible from the Native API and therefore it's not possible use them in REGLN. The only valid "root keys" are:

  Win32                    Abbr       Namespace
  -----------------------------------------------------
  HKEY_LOCAL_MACHINE       HKLM       \Registry\Machine
  HKEY_USERS               HKUS       \Registry\User

Note: For compatibility with scripts and other utilities the root key name "HKU" was added as synonym of HKUS or HKEY_USERS.

The keys: HKEY_CURRENT_USER, HKEY_DYN_DATA, HKEY_CLASSES_ROOT or any other CANNOT be used by REGLN. No, it is not possible at all.

Also you cannot create links (or any other keys) directly under the "root keys", for example from one user profile (in HKUS) to another. Also you cannot link HKLM\FREEWARE to HKLM\SOFTWARE etc. If you want to do that, you have to load up the hive file and link it's all top-level entries. Perhaps it would be possible to do that using Namespace Links, however it's out of scope of this utility.

To Delete a registry link you simply have to specify the link-key name with "-d" option. It does not matter if the link is volatile or not.

Examples

  regln -v HKLM\Software\TestInc  HKLM\Software\Microsoft

Will create a temporary link TestInc pointing to Microsoft. If you open Regedit or any other registry editor and go to HKLM->Software and then TestInc you will see exacly same content as in Microsoft key. If you add/delete/change something in the Microsoft tree, it will be obviously instantly "changed" in TestInc as well. (Remember to refresh display by pressing F5 if you're using the system regedit.exe)

  regln -d HKLM\Software\TestInc

Will remove the link...

Now a more advanced example:

You can rename HKLM\Software\Microsoft\Windows\CurrentVersion to HKLM\Software\Microsoft\Windows\Version1 and create creatie a following link:

  regln \Registry\Machine\Software\Microsoft\Windows\CurrentVersion 
        \Registry\Machine\Software\Microsoft\Windows\Version1

This will create a permanent link pointing from CurrentVersion to the existing key Version1. Now copy the whole tree recursively from Version1 to Version2 so that you'll have:

  HKLM\Software\Microsoft\Windows:

      - CurrentVersion --LINK-->> Version1
      - Version1
      - Version2

Now, you change some variables in Version2 and try to re-link the key CurrentVersion to Version2 by executing:

  regln -d \Registry\Machine\Software\Microsoft\Windows\CurrentVersion 

  regln \Registry\Machine\Software\Microsoft\Windows\CurrentVersion 
        \Registry\Machine\Software\Microsoft\Windows\Version2

As you can see, you can have several "sets of settings" for various purposes, and swap them around easily. It seems clear that the "CurrentVersion" key was really intended just for that, except it was never fully implemented until now.

Note you have to extend Registry Quota to have enough space to do things like this. Also most applications will have open handles to the registry keys and will write to the old place so you usualy will have to reboot to use this. However if the application uses registry dynamically (opens and closes keys), it will work just fine.

Real life use of Registry Links

Microsoft Windows uses Registry Links internally for the feature better known as "Last Good Known Configuration" to this day.

Windows used to have concept of Hardware Profiles prior to Windows XP. The feature allowed to have some Windows settings changed at boot time by selecting one of the profiles. The amount of Hardware Profile dependent settings was rather limited. Regln allows to extend the functionality by making any Windows registry key to be profile dependent.

Regln has been used to allow to split various system level settings to be made user dependent by linking them from HKLM to HKUS. Similarly settings that are normally user dependent (HKUS) can be made system wide (HKLM) so that every user will have the same centrally managed settings. This has been extensively used in Terminal Server Edition deployments.

Registry links have been used to link a group of disperse and unrelated settings to be stored in the same hive file.

The application has been used to make several user profiles to link their settings to a single "master" user.

More recently it was reported that Regln was used to solve a problem with daylight saving time and TZInfo over reboot of a EWF enabled device on Windows XP Embedded.

License

Apache 2.0

Credits

Antoni Sawicki <[email protected]>
Tomasz Nowak <[email protected]>
Mark Russinovitch <[email protected]>

Thanks to [email protected] for recent code fixes
Special thanks to TMYK

regln's People

Contributors

tenox7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

regln's Issues

access denied on windows 7-10

\registry\user link to \registry\machine link causes access denied when accessing the link

repro steps:

c:\>regln -v \REGISTRY\USER\S-1-2-3-MY-USER-SID\Test  \REGISTRY\MACHINE\SOFTWARE\Microsoft

c:\>reg query HKU\S-1-2-3-MY-USER-SID\Test
ERROR: Access is denied.

Unable to delete link

I have a registry key that I cannot delete. If I try to click on or delete the key, I get the error "An error is preventing this key from being opened. Details: The system cannot find the file specified." If I try to delete the branch, I get a generic "error while deleting key"

The key is "HKU\S-1-5-21-3149309343-1769326203-569191401-1001_Classes\WOW6432Node\CLSID{130F8154-E804-4BD5-A07B-35BE69039715}{A730F6F3-255C-417C-8986-2C578500547E}"

When trying with regln it gives me no output at all. Am i doing it wrong?
Thanks

unable to create link

can not create link by regln with or without -v
the following is my command
regln-x64.exe -v "regln-x64.exe -v "HKUS\Software\紫龙游戏\天地劫:幽城再临\tt" "HKUS\Software\紫龙游戏\天地劫:幽城再临\BundleDataVersion_h3598615131""
not sure if it is due to simple chinese in my keys.
and the err info is: ERROR: Unable to create registry key "\Registry\Machine\Software????????????\tt" (NtCreateKey) [C0000034]

Missing installation / compilation instructions

How does one deploy this? Which compiler should be used?

Is there a signed, pre-built executable anywhere?

I was linked to this project from https://pupuweb.com/solved-fix-error-opening-registry-key/, and that pages just says to copy the .c file straight to C:\Windows\System32\ ...

This made me raise and eyebrow, I tried it without luck anyway.

Just consider this ticket to be a fault with README.md - it's generally nice if there's at least a short mention of the tools and procedure needed to get a project up and running.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.