As already mentioned in your subsequent answer, you should use the /F
option with Add
to force the overwriting of existing value data. Please open a Command Prompt window type reg /?
and press the ENTER key to read the usage information.
However, there were several other issues with what you've posted, so I have rewritten the entire thing for you in two possible formats, (as I was unsure of your true intention).
Please note that I have made several, more appropriate, changes to what you posted, please do not modify any of the content I have posted, it has been written using the correct syntax, keys, values and data. Please also remember that this code is adding to a protected area of the Windows registry, so you must be running this script elevated or as a user with the required permissions.
This is how I'd suggest you perform the task, if you only want to add all of the registry keys, if there is already an existing value named Patcher
:
@Echo Off
SetLocal EnableExtensions
Set "Key=HKLMSOFTWARENtreevPangYa_Th"
Set "Reg=%SystemRoot%System32
eg.exe"
%Reg% Query "%Key%" /Reg:32 /F "Patcher" /V 1> NUL 2>&1 && (
%Reg% Add "%Key%" /Reg:32 /V "Argument" /D "not_used" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "Install_Dir" /D ""C:Pangya eXtremV2"" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "IntegratedPak" /D "projectg500+.pak" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "Launcher Version" /D "v3.1" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "Patcher" /D "Updater_Launcher_ENG.exe" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "PatchNum" /D "184" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "Ver" /D "TH.R4.584.04" /F 1> NUL
)
If you simply want to add all of the data regardless of any existing values, then just this would be all you need:
@Echo Off
SetLocal EnableExtensions
Set "Key=HKLMSOFTWARENtreevPangYa_Th"
Set "Reg=%SystemRoot%System32
eg.exe"
%Reg% Add "%Key%" /Reg:32 /V "Argument" /D "not_used" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "Install_Dir" /D ""C:Pangya eXtremV2"" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "IntegratedPak" /D "projectg500+.pak" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "Launcher Version" /D "v3.1" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "Patcher" /D "Updater_Launcher_ENG.exe" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "PatchNum" /D "184" /F 1> NUL
%Reg% Add "%Key%" /Reg:32 /V "Ver" /D "TH.R4.584.04" /F 1> NUL
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…