K2000 Task - How to Add a DWORD to Existing Registry Key Using .bat/cmd or PowerShell?
Hey Guys,
I need to add a DWORD to an existing registry key. Locally, if I open CMD or PowerShell and paste the command, it generates a completion successful message. I confirm this by navigating to the specific key.
However, the post task variations I have tried with the same command as a .bat or trying to launch cmd with the command do not seem to be adding the DWORD to the key (however the tasks do not fail). Command is:
reg add HKLM\System\CurrentControlSet\Control\Lsa /v LsaAllowReturningUnencryptedSecrets /t REG_DWORD /d 1 /f
I have tried running .bat starting cmd with the aforementioned command but no joy. It usually just launches cmd.exe and doesn't run the command, or fails with other variations.
Can anyone guide me on how to create a .bat file which launches cmd or PowerShell with the given command, then exits when finished?
I do not want to delete/import the updated key as deleting it lead to boot failure on 2 test machines.
FYI:
- Using W10 1703 x64
Thanks Everyone.
-
create .bat with reg import LSA.reg containing your exported reg key (delete all other values if there are more than just that setting in export.reg) zip it and upload to k2000 then set parameter your.bat in postinstall task - n1md4 7 years ago
Answers (0)
Be the first to answer this question