Automatic Remote REGEDIT?

Posted on

QUESTION :

I’ve got a lot of computers on the domain here that do not have remote desktop enabled. I can open the command prompt and do this command:

REG.exe ADD \[the machine im doing this to]HKLMSYSTEMCurrentControlSet
Control\"Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0

and it works perfectly fine, except for one thing – it makes a prompt asking if I’m sure I want to do this, Yes/No. How would I go about having a batch file auto-answer YES to this, so I don’t have to type it every time? It wouldn’t be a problem if it was just a couple hundred machines, but there’s plenty more than that and it would take a while to do this by hand. Not to mention I might have to sweep a few times to make sure every computer is turned on and is affected by this.

ANSWER :

From the output of reg add /?:

/f Force overwriting the existing registry entry without prompt.

Just add that to the end of your command.

Leave a Reply

Your email address will not be published. Required fields are marked *