Seite 1 von 1

Importing .reg-files

Verfasst: 11 Feb 2013, 15:09
von bobzbobz
Hi

I am trying to create a script, which imports A LOT of registry-keys - is it possible to import them from a .reg-file instead of creating a [Registry_Install]-section?

(The problem is that it should be for all users in HKCU)

Best Regards,
Soren

Re: Importing .reg-files

Verfasst: 11 Feb 2013, 16:56
von SisterOfMercy
If you need to install registry keys to all users, call the [registry_install] section with /AllNTUserDats, like this:

Code: Alles auswählen

if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
   Message "Installing " + $ProductId$ + " 64 Bit..."
   comment "Start setup program"
   Winbatch_install_64
   Sub_check_exitcode
   comment "Copy files"
   Files_install /AllNTUserProfiles
   Files_install_64
   comment "Patch Registry"
   Registry_install /AllNTUserDats
endif


And of course you can also import a .reg file, just call regedit silently with the .reg file to import. Look here: http://ss64.com/nt/regedit.html

Personally I prefer to keep changes in one place, and that is in the OPSI script.

Re: Importing .reg-files

Verfasst: 22 Feb 2013, 21:07
von d.oertel

Re: Importing .reg-files

Verfasst: 04 Mär 2013, 08:28
von bobzbobz
Thanks :)

Regards,
Soren

Re: Importing .reg-files

Verfasst: 02 Nov 2020, 13:40
von crawleroz1
I had the same problem the following was the solution:

[Actions]
registry "%scriptpath%\Data\reg\my.reg" /regedit /AllNTUserDats

:!: