Modifying Many Registry Entries Remotely

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have made a simple bat file below:

for /F %%a in (c:\tmp\iplist.txt) do call :MODREG %%a
goto :EOF

:MODREG

echo "***************************************************************" >>
output.log 2>&1
echo %1 >> output.log 2>&1
echo "*************************************************************" >>
output.log 2>&1


net use z: \\%1\c$ /user:domain\user "password" >> output.log 2>&1

c:\tmp\reg add "\\%1\HKLM\Software\123\456\Network" /v SyslogDest /t
REG_DWORD /d 26 /f >> output.log 2>&1


echo "**** END **** " >>output.log 2>&1
echo
"**********************************************************************" >>
output.log 2>&1

:EOF

This file will take a list if ip's in the file connect and make the
necessary modification to the registry.

However, I am using the same script to make additional mods as follows and
it's not working...

[HKEY_LOCAL_MACHINE\SOFTWARE\123\456\Network]
"Destination"="192.168.1.1"
"DestPort"=dword:00001811
"Syslog"=dword:00000000
"SyslogDest"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\123\456\Objective]
"Objective0"="2 1 16 * *** 0 *"
"Objective1"="4 4 16 * *** 0 *"

How can I add this to the script?

Thanks
 
I have made a simple bat file below:

for /F %%a in (c:\tmp\iplist.txt) do call :MODREG %%a
goto :EOF

:MODREG

echo "***************************************************************" >>
output.log 2>&1
echo %1 >> output.log 2>&1
echo "*************************************************************" >>
output.log 2>&1


net use z: \\%1\c$ /user:domain\user "password" >> output.log 2>&1

c:\tmp\reg add "\\%1\HKLM\Software\123\456\Network" /v SyslogDest /t
REG_DWORD /d 26 /f >> output.log 2>&1


echo "**** END **** " >>output.log 2>&1
echo
"**********************************************************************" >>
output.log 2>&1

:EOF

This file will take a list if ip's in the file connect and make the
necessary modification to the registry.

However, I am using the same script to make additional mods as follows and
it's not working...

[HKEY_LOCAL_MACHINE\SOFTWARE\123\456\Network]
"Destination"="192.168.1.1"
"DestPort"=dword:00001811
"Syslog"=dword:00000000
"SyslogDest"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\123\456\Objective]
"Objective0"="2 1 16 * *** 0 *"
"Objective1"="4 4 16 * *** 0 *"

How can I add this to the script?

Thanks


c:\tmp\reg add "\\%1\HKLM\Software\123\456\Network" /v Destination /T REG_SZ /F /D "192.168.1.1"
c:\tmp\reg add "\\%1\HKLM\Software\123\456\Network" /v DestPort /T REG_DWORD /F /D 0x1811
c:\tmp\reg add "\\%1\HKLM\Software\123\456\Network" /v Syslog /T REG_DWORD /F /D 0
c:\tmp\reg add "\\%1\HKLM\Software\123\456\Network" /v SyslogDest /T REG_DWORD /F /D 0xa
c:\tmp\reg add "\\%1\HKLM\Software\123\456\Network\Objective" /v Objective0 /T REG_SZ /F /D "2 1 16 * *** 0 *"
c:\tmp\reg add "\\%1\HKLM\Software\123\456\Network\Objective" /v Objective1 /T REG_SZ /F /D "4 4 16 * *** 0 *"



Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top