Importing .reg-files

bobzbobz
Beiträge: 149
Registriert: 30 Nov 2012, 10:41
Wohnort: Denmark

Importing .reg-files

Beitragvon bobzbobz » 11 Feb 2013, 15:09

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
Please help others by sharing your scripts on the OPSI-Wiki.

Benutzeravatar
SisterOfMercy
Beiträge: 1199
Registriert: 22 Jun 2012, 19:18

Re: Importing .reg-files

Beitragvon SisterOfMercy » 11 Feb 2013, 16:56

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.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!

Benutzeravatar
d.oertel
uib-Team
Beiträge: 3288
Registriert: 04 Jun 2008, 14:27

Re: Importing .reg-files

Beitragvon d.oertel » 22 Feb 2013, 21:07

opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org

bobzbobz
Beiträge: 149
Registriert: 30 Nov 2012, 10:41
Wohnort: Denmark

Re: Importing .reg-files

Beitragvon bobzbobz » 04 Mär 2013, 08:28

Thanks :)

Regards,
Soren
Please help others by sharing your scripts on the OPSI-Wiki.

crawleroz1
Beiträge: 35
Registriert: 13 Mär 2018, 11:36

Re: Importing .reg-files

Beitragvon crawleroz1 » 02 Nov 2020, 13:40

I had the same problem the following was the solution:

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

:!: