|Not enough space in the subject box.|
Here's what I have (and I am new to any type of scripting):
Currently I have a .bat file that ssh's into a particular device (using PLINK) and accepts the RSA2 disclaimer. It logs out and re-initiates an SSH session where it enables FTP on the device. After that the script initiates an FTP session where it uploads a new config file (.ini). After the config file is uploaded it initiates another SSH session, executes a few more commands, outputs some info to a .txt file and closes. I have this working very well.
Here's what I aim to attempt to do.
I have 200+ of these devices and 200+ config files. I need to figure out how to use a For /F command to log into each device (pulling each IP from .txt file) and upload each specific config (all housed in the same folder and each named with it's DNS).
Config files named:
Reiterating: I need the script to log into each device and upload each specific config file.
Here's the generic version of my first batch file:
cmd.exe /c echo y | plink -v -l username -pw password PDU1 exit
timeout /t 3
plink -l username -pw password PDU1 < Initial_Commands.txt
timeout /t 30
Here's the next part (FTP portion):
ftp -i -s:FTP_Commands.bat
timeout /t 5
Here's the final leg:
plink -v -l username -pw password PDU1 < Final_Commands.txt >>output.txt
I realize it's a lot to follow so I apologize if my request is vague or unclear. Any help is greatly appreciated.