Reputation: 21
I would like to know how to launch a .reg file using NSIS.
this file looks like this:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching] "SearchOrderConfig"=dword:00000003
thanks in advance! Bye
Upvotes: 2
Views: 1114
Reputation: 101559
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" "SearchOrderConfig" 0x00000003
There are two things issues you need to deal with for this to work:
Only administrators can write to HKLM so you need to add RequestExecutionLevel admin
to your script.
On 64-bit versions of Windows this is going to write to the 32-bit view of the registry so you probably want to call SetRegView 64
before WriteRegDWORD
.
It can be helpful to use Process Monitor to see why a registry write fails and to verify that you are writing to the correct place.
Upvotes: 1