Hi everyone,
this is my first post
I realized this simple script that changes the IP addresses associated to a printer installed on the user computer.
It reads old and new printer IP addresses from an external txt file and change it accordingly
@echo off
echo ****************************************************************
echo *** Printers are being updated to the new IP, please wait ...
for /F "tokens=1,2 delims=," %%g in (Printers_CMO-FMO.txt) do wmic path win32_tcpipprinterport where "hostaddress = '%%g'" set hostaddress= "'%%h'" >nul
echo ***
echo *** Update completed!
echo ****************************************************************
pause
the format of the txt file that feed it:
10.248.16.27,10.19.60.7
xx
xxx
x
x
x
The script it's working! all good!
Only thing I'd like to show a message in the end that says something like
Success!
5 printers were successfully updated
10.248.16.27 -> 10.248.17.XX
10.248.16.28 -> 10.248.17.XX
10.248.16.29 -> 10.248.17XX
10.248.16.30 -> 10.248.17.XX
10.248.16.21 -> 10.248.17.XX
Actually I am using the >nul parameter to stop all messages from being shown to user
Can anybody suggest a way to achieve this?
Thanks!
Controlling the output of a script changing IP addresses for installed printers
Moderator: DosItHelp