因此,我有一个批处理脚本,该脚本可以telnet到交换机并在其上运行一些命令。
我每次都需要在文本文件中更改一行。这是IP地址的第五行。我该怎么办?
@echo off
set IP=""
:start
set /p IP="Enter IP Adress:"
echo : IP is set to %IP%
cd "C:\Program Files\PuTTY\"
echo : Trying to connect to %IP%
plink.exe -telnet %IP% < C:\Users\w0w40\Desktop\5ahitn\shruns\commands.txt
for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a
pause
goto start
这是主要的批处理脚本,我需要替换为COMMANDS.txt
ITAC
enable
ITAC
copy running-config tftp:
10.51.11.75
我需要替换主批处理脚本中的IP地址