Regedit-Format: .reg nicht importierbar - Synaxfehler?

Antworten
reznor
Beiträge: 5
Registriert: 28 Nov 2013, 17:24

Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von reznor »

Hallo,

Ich möchte eine registry Exportdatei per opsi verteilen.

Das steht u.A. in der setup.ins:

Code: Alles auswählen

Registry_install /AllNTUserDats

[Registry_install]
registry "%ScriptPath%\pdf24.reg" /regedit
... und in der Logdatei erscheint folgende Fehlermeldung:

Syntax Error in Section: Registry_install (Command in line 141): registry "P:\pdf24\pdf24.reg" /regedit -> OpenKey expected

OpenKey will/brauche ich hier doch nicht, ich versteh das nicht!

So habe ich die pdf24.reg erstellt:
- Unter Win7 exportiert
- Von utf-16 nach utf-8 konvertiert
- Aus allen Sektionen HKCU entfernt wie im Handbuch beschrieben
- Andere Sektionen gibt's nicht, nun fängt alles mit [Software\... an

Kann mir Jemand bitte die Richtung weisen?
Laut Handbuch sollte die Syntax doch stimmen...

Besten Dank und Grüße!
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von SisterOfMercy »

Do not use separate .reg files. Here, an example from a working script:

Code: Alles auswählen

[Registry_install_AllProfiles]
; Allow cmd.exe to use UNC paths
openkey [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
set "DisableUNCCheck" = REG_DWORD:00000001

; Explorer policies
openkey [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer]
; No AutoRun
set "NoDriveTypeAutoRun" = REG_DWORD:00000255
; No Recent Documents
set "NoRecentDocsMenu" = REG_DWORD:00000001
set "NoRecentDocsHistory" = REG_DWORD:00000001
; Do not add shares from recently opened documents to the My Network Places folder
set "NoRecentDocsNetHood" = REG_DWORD:00000001
; No Start Menu help
set "NoSMHelp" = REG_DWORD:00000001
; Don not run the Desktop Cleanup Wizard, also removes option in menu
set "NoDesktopCleanupWizard" = REG_DWORD:00000001
; Disable active desktop
set "NoActiveDesktop" = REG_DWORD:00000001
; Don't create a Shared Documents folder for My Computer 
set "NoSharedDocuments" = REG_DWORD:00000001
;  Hide the Start Button BalloonTip (Click here to begin)
set "NoSMballoonTip" = REG_DWORD:00000001
; Turn off personalized menus, also removes option in menu
set "Intellimenus" = REG_DWORD:00000001
; Turn off CD-burning via explorer
set "NoCDBurning" = REG_DWORD:00000001
; Do not cache thumbnails
set "NoThumbnailCache" = REG_DWORD:00000001
; Remove internet explorer icon from desktop
set "NoInternetIcon" = REG_DWORD:00000001
; Remove network places from desktop
set "NoNetHood" = REG_DWORD:00000001
; Do not use the search/tracking-based method when resolving shell shortcuts
set "NoResolveSearch" = REG_DWORD:00000001
set "NoResolveTrack" = REG_DWORD:00000001
; Disable category view in control panel
set "ForceClassicControlPanel" = REG_DWORD:00000001
; Disable menu animation user interface
set "NoChangeAnimation" = REG_DWORD:00000001
; Disable DFS tab
set "NoDFSTab" = REG_DWORD:00000001
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
reznor
Beiträge: 5
Registriert: 28 Nov 2013, 17:24

Re: Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von reznor »

Well, this would result in a rather large setup.ins.

What's wrong with importing reg-files as documented in the manual?
(8.11.5. Registry Sections in Regedit Format)

http://download.uib.de/opsi_stable/doc/ ... anual.html
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von SisterOfMercy »

A large setup.ins is more managable than a lot of small .reg files, in my opinion.

But you can also do it your way. I don't really understand the manual in that section either, but you can always use a winbatch part to use reg.exe to import .reg files:

Code: Alles auswählen

[Winbatch_install_64]
; Installation of RDP 6.0 client, included as an example
"%ScriptPath%\files\WindowsServer2003.WindowsXP-KB925876-v2-x64-ENU.exe" /quiet /norestart /nobackup

"%SystemRoot%\system32\reg.exe" import "%ScriptPath%\files\yourregfiles.reg" /f
I _think_ it works that way, but you'd have to check it first.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
reznor
Beiträge: 5
Registriert: 28 Nov 2013, 17:24

Re: Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von reznor »

I'd prefer one large .reg file.
I'll try the winbatch install on Tuesday.
Thanks a lot so far.
reznor
Beiträge: 5
Registriert: 28 Nov 2013, 17:24

Re: Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von reznor »

This does not work for me.
I have to import HKCU-keys for all users. This is only possible with the function
Registry_install /AllNTUserDats
, which is not working as expected.
Any other ideas?
Thanks a lot
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von n.wenselowski »

Hallo reznor,

ich würde eine Variante wie von SisterOfMercy versuchen - Winbatch-Sektion und darin reg.exe aufrufen.

Was genau funktioniert nicht wie erwartet beim Aufruf der Registry-Sektion?
Das Debuggen von solchem Problemen per Forum gestaltet sich nicht immer so einfach - die nervenschonendste Variante ist in der Regel ein Support-Vertrag ;)


Gruß

NW

Code: Alles auswählen

import OPSI
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von SisterOfMercy »

reznor hat geschrieben:This does not work for me.
I have to import HKCU-keys for all users. This is only possible with the function "Registry_install /AllNTUserDats", which is not working as expected.
What do you expect? In my scripts I use this, which works correctly:

Code: Alles auswählen

[Actions]
Registry_install /64Bit
Registry_install_AllProfiles /AllNTUserDats

[Registry_install]
openkey [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WZCSVC]
set "Start" = REG_DWORD:00000004
; Network Provisioning Service:
openkey [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\xmlprov]
set "Start" = REG_DWORD:00000004

[Registry_install_AllProfiles]
; Folder View Options
openkey [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
deletevar "Shellstate"
openkey [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
deletevar "Settings"
Otherwise, I think what they mean with the 8.11.5 part of the manual:

Code: Alles auswählen

[Actions]
registry "%scriptpath%\files\opsiorgkey.reg" /regedit
In the actions part of the script, and not in the [registry_install] section.. I have not tested this, but it is the same as with patching a .ini file, which I did test (and works).
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
reznor
Beiträge: 5
Registriert: 28 Nov 2013, 17:24

Re: Regedit-Format: .reg nicht importierbar - Synaxfehler?

Beitrag von reznor »

Sorry for the late response, there were more important tasks to do.

As advised I did it without .reg-file, now it works flawless for all existing accounts plus the default.

Thanks for your help!
[Actions]
Registry_install /AllNTUserDats

[Registry_install]
openkey [HKEY_CURRENT_USER\...]
set "..."="..."
Antworten