Using cmd to edit reg keys? [closed]
I need to edit 2 registry keys in Windows 8.1 but make it in a way to be able to use them in a batch file to be able to use them on more than 1 PC. In the batch file I will have more reg key's that will also make few other changes; but the 2 keys that i need to change are:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient
in here I need to change the value of the "SpecialPollInterval" key from the default to 3600.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient
in here I need to change the value of the "SpecialPollTimeRemaining" key to my NTP server.
Or need some other way to change the default ntp server from cmd and resync it in Win 8.1, that can be added to a batch file.
How I've tried to edit the above keys is like this:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t REG_DWORD /d 3600 /freg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service\W32Time\TimeProviders\NtpClient /v SpecialPollTimeRemaining /t REG_MULTI_SZ /d ntp.server,7c30bcf /f
They complete succesfully but no changes are made, the keys are not created nor edited
Need to add those 2 in the batch file I have made (code so far):
@echo on
bcdedit /set recoveryenabled no
tzutil /s "GTB Standard Time"
reg add HKLM\Software\BrowserChoice /v Enable /t REG_DWORD /d 0 /f
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fAllowToGetHelp /t REG_DWORD /d 1 /f 3 2 Answers
You will need to make sure to run as administrator, otherwise you will not actually have the permissions required to modify the registry.
If you're running the commands manually from a command prompt with elevated permissions you'll notice the commands worked fine but once you try to click on the batch files from windows explorer or automate them (without giving admin rights) it will only run the commands as a standard user.
Got it done seems the problem was a mistyped word.... no wonder it did not work missed a letter from a word lol