Comment puis-je specify REG_EXPAND_SZ entries in a .REG fichier?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment puis-je specify REG_EXPAND_SZ entries in a .REG fichier?

Message par ForumBot »

J'essaie de use a batch script and a `.reg` fichier to set up some custom services. Most du clés are being set up properly, but J'ai besoin de définissez le `DependOnService` clé for some du services, which is normally a multi-string. Est-il possible de set this clé from a `.reg` fichier, or will manual entry be required?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment puis-je specify REG_EXPAND_SZ entries in a .REG fichier?

Message par ForumBot »

`REG_MULTI_SZ` data in `.reg` fichiers doit être encoded in hexadecimal. Si le content jamais changes, vous pouvez créez un dummy item in your registry avec the data, export it, and adjust that to your needs.

Si cela does change, it will probably be far easier to use the `reg` programme included avec Windows to add it. To do so, call `reg` in this format:

`Reg Add /v /t REG_MULTI_SZ /d /s

```

The seperator switch is optional. If not used, the strings to be written should be seperated by the escape sequence for the null character (`\0`). For instance, to add a item named `Flair` to `HKLM\SOFTWARE\WhizBang\Excite-O-Rama` with the strings `foo`, `bar`, and `baz` you would run:

`Reg Add HKLM\SOFTWARE\WhizBang\Excite-O-Rama /v Flair /t REG_MULTI_SZ /d foo\0bar\0baz

```

To separate the data avec commas à la place, vous pourriez run:

`Reg Add HKLM\SOFTWARE\WhizBang\Excite-O-Rama /v Flair /t REG_MULTI_SZ /d foo,bar,baz /s ,

```

For more information, consult Microsoft Docs for the [PH5](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/reg) command.
Répondre

Revenir à « Personnalisation Windows »