Hello,

I have to make some changes in the registry either via batch file or powershell script. Can anyone me in writing a powershell script or batch file to make all these below changes :-

reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

reg.exe ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile /v EnableFirewall /t REG_DWORD /d 0 /f

reg.exe ADD \HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoUpdate /t REG_DWORD /d 0 /f

reg.exe ADD \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers /v C:\WINDOWS\system32\cmd.exe /t REG_DWORD /d `RUNASADMIN /f

actually wan to make these changes via one batch file -

  1. Windows firewall protection should be turned off.

  2. Automatic updates should be turned off

  3. Change UAC to Never notify.

  4. Make command prompt always run as administrator.

6 Spice ups

Modify the reg on one machine and export the keys to a reg file. Click and import. If you insist on a script then my question is “what kind of code have you come up with?”. We’re no homework service :thinking:

https://stackoverflow.com/questions/49676660/how-to-run-the-reg-file-using-powershell

Read this and give it a try

img6363493133816202376.jpg

Take the code you’ve provided, save it all into a file with a .cmd extension. There you go, script complete.

thanks all ready did and it worked :slight_smile:

If you want to learn Powershell, you can accomplish the same registry changes with New-ItemProperty and New-ItemPropertyValue.

An example is in my guide here: