Dos Batch and FTP file Question.
Posted: 09 Sep 2009 14:38
I am trying to write a batch file that you can enter in an IP of a network printer and then select the model printer it is. At this point it will run FTP and update the firmware of that printer. I have it working minus the IP getting entered into the ftpscript.txt file. Any help would be great.
Thank You
Batch file is below. I am only working on the HP LJ 4250. Once I get that working I will get the others typed up.
@echo off
:start
@echo This will update the firmware on HP Printers
@echo This could take up to 5 minutes
@echo.
@echo Please type in the IP of the printer to upgrade
set /p ip=
@echo.
@echo Which printer is this?
@echo 1) LJ 24xx
@echo 2) LJ P3005
@echo 3) LJ 4200
@echo 4) LJ 4250
@echo 5) LJ P4015
@echo 6) LJ CP1518 Color
@echo 7) LJ CP3525 Color
@echo LJ 4600 Color
@echo 9) LJ 4650 Color
@echo 10) LJ 4700 Color
set /p model=
if '%model%'=='1' goto lj24xx
if '%model%'=='2' goto ljp3005
if '%model%'=='3' goto lj4200
if '%model%'=='4' goto lj4250
if '%model%'=='5' goto ljp4015
if '%model%'=='6' goto ljcp1518
if '%model%'=='7' goto ljcp3525
if '%model%'=='8' goto lj4600
if '%model%'=='9' goto lj4650
if '%model%'=='10' goto lj4700
:lj4250
ftp -v -i -s:ftpscript.txt
goto upanother
:upanother
@echo Upgrade complete would you like to upgrade another (y/n)?
set /p another=
if '%another%'=='y' goto start
if '%another%'=='n' goto end
:end
exit
Here is the ftpscript.txt
open %ip%
username
password
put H:\ITM03\Drivers\Printers\HP\Firmware\lj4250.rfu
bye
I know the %ip% is not the correct thing but I need a way to pull that IP address. That is what I really need help with.
Thank You
Batch file is below. I am only working on the HP LJ 4250. Once I get that working I will get the others typed up.
@echo off
:start
@echo This will update the firmware on HP Printers
@echo This could take up to 5 minutes
@echo.
@echo Please type in the IP of the printer to upgrade
set /p ip=
@echo.
@echo Which printer is this?
@echo 1) LJ 24xx
@echo 2) LJ P3005
@echo 3) LJ 4200
@echo 4) LJ 4250
@echo 5) LJ P4015
@echo 6) LJ CP1518 Color
@echo 7) LJ CP3525 Color
@echo LJ 4600 Color
@echo 9) LJ 4650 Color
@echo 10) LJ 4700 Color
set /p model=
if '%model%'=='1' goto lj24xx
if '%model%'=='2' goto ljp3005
if '%model%'=='3' goto lj4200
if '%model%'=='4' goto lj4250
if '%model%'=='5' goto ljp4015
if '%model%'=='6' goto ljcp1518
if '%model%'=='7' goto ljcp3525
if '%model%'=='8' goto lj4600
if '%model%'=='9' goto lj4650
if '%model%'=='10' goto lj4700
:lj4250
ftp -v -i -s:ftpscript.txt
goto upanother
:upanother
@echo Upgrade complete would you like to upgrade another (y/n)?
set /p another=
if '%another%'=='y' goto start
if '%another%'=='n' goto end
:end
exit
Here is the ftpscript.txt
open %ip%
username
password
put H:\ITM03\Drivers\Printers\HP\Firmware\lj4250.rfu
bye
I know the %ip% is not the correct thing but I need a way to pull that IP address. That is what I really need help with.