How to Set a Registry Entry on Multple Computers
Wednesday, 30 December 2009

This tip explains how to use the FOR loop to set a registry entry on multiple computers.

As an example, you want to enable ScreenSaveActive on all computers on your network.

This is how you accomplish this:

  1. Create a text file called COMPUTERS.TXT
  2. Put all the computer names in it.
  3. Next run the following command from a command window:

FOR /F "Tokens=*" %A IN (COMPUTERS.TXT) DO REG.EXE Add 
"\\%A\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon /v ScreenSaveActive /d REG_DWORD /v 1 /F


The above command runs on all the computers mentioned in the COMPUTERS.TXT file and executes the REG.EXE command against each of them.

 

 
< Prev   Next >
Advertisement
© d-PIT, 2007-2010.

Site Disclaimer