The popups are 1) a
User Access Control (UAC) prompt asking "Do you want to allow this app to make changes to your device"; 2) a
Registry Editor prompt asking "Are you sure you want to continue?" and; 3) a
Registry Editor message informing you whether the 'merge' succeeded. This is because just 'running' a REG file invokes the Registry Editor by default.
As BoBo suggests, using AHK's
RegWrite is usually the best way to go.
Note:
1. You need to be aware of the effect of using a 32-bit version of AHK with a 64-bit OS and
vice versa. See
SetRegView for more info.
2. You will have to elevate the command (i.e. invoke a UAC) if the .REG file to be imported writes to the 'machine' hive (HKLM) rather than the 'user' hive (HKCU).
3. You may need to restart Explorer, sign out/sign in or restart for some registry changes to take effect, especially if they are machine-wide.
For example, the following DOESN'T need to run elevated because it's writing to HKCU, DOES need
SetRegView 'cos I'm using the 32-bit version of AHK in a 64-bit environment and the registry change DOESN'T take effect until Explorer is restarted:
Code: Select all
; Taskbar - Show/hide People icon (1=Enable/Show / 0=Disable/Hide)
SetRegView, 64
RegWrite, REG_DWORD, HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People, PeopleBand, 0
SetRegView, Default
; Restart Explorer
psScript =
(
Stop-Process -ProcessName explorer -Force
)
Run PowerShell.exe -Command %psScript%,, hide
If, however, the .REG files are lengthy/complicated then an alternative is to use
AHK to run the commandline
reg.exe and pass the .REG file as an
import parameter. This will avoid the confirmation prompts, including overwriting existing values if you use the
/f (force) switch. You can read more about the use of
reg.exe here:
https://ss64.com/nt/reg.html.
You can run
reg.exe from
AHK using
comspec (and its
/hide switch) to hide what's happening but you may still need to use elevation.
Hope this helps...