You are not logged in.

#1 08 Sep 2016 18:28

Eehixohw
Member
Registered: 25 Sep 2011
Posts: 40

Change Printer IP in Registry using value from external file

Hello guys.
I have a printer installed using an old ip address and I need to do a complete search of the registry and replace the old IP with the new IP. Normally, this would've been done manually but I have many such machines and I'd like to do it via script if possible.

To better ilustrate the expected result, take the following key:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\SWD\DAFWSDProvider\uuid:4509a320-00b9-0028-0030-00251a4fdaf9
Which has a value called LocationInformation and a value of http.//172.28.208.10:5358/DeviceService/

The script should search the registry for the OLD IP and, if exists, replace it with the NEW IP.
The IP addresses are stored in a text file (ip.txt) as follows:

OLD IP NEW IP
172.28.208.10 172.28.145.200
172.28.205.22 172.28.149.203


Thank you for all your help

Offline

Board footer

Powered by