Force program to read HKCU instead of HKLM

Discussion in 'Application Software' started by Soulfate, Sep 13, 2015.

  1. Soulfate

    Soulfate MDL Member

    Feb 14, 2011
    185
    49
    10
    Hi,
    I want to make a BATCH script to "portabilize" a program that doesn't need more than "users" rights (doesn't need "Admin" rights/privileges). That program reads registry keys and values in HK_LOCAL_MACHINE to define some options and variables.

    I would like to force that program to read HK_CURRENT_USER (or any other registry key that doesn't need more than "users" rights) instead of HK_LOCAL_MACHINE because I don't want my BATCH script to need elevated privileges (and call an UAC prompt) to set up my program.

    Furthermore, if it is also possible to redirect a folder that need elevated privileges to another folder (that does'nt need elevated privileges) without the need to elevate privileges, I'm interested. It's not important for this case because my program doesn't write or read anything in any folder needing elevated privileges, but it could be really interesting for future "portabilizations".
    I know that I could use "MKLINK /j" command to redirect a folder to another, but if the junction is created into an elevated privileges folder, script needs elevated privileges.

    Thank you for any help ;)