Search code examples
batch-fileregistrybatch-processingsafe-mode

How to add two values in a registry with batch script?


I want to edit the registry key below...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

The default data for valuename Shell is explorer.exe

I want to edit to be like explorer.exe,Myapp1,Myapp2

I did it manually, but is it possible to do it with a batch script?


Solution

  • You can use:
    REG ADD [ROOT\]RegKey /v ValueName [/t DataType] [/S Separator] [/d Data] [/f]

    in your batch to change/add registry keys. So it would be:

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe,Myapp1,Myapp2" /f

    For more details refer to: http://ss64.com/nt/reg.html