Am I undestanding you correctly that you want a batch file that creates another batch file as well as a text file?
I am not really following your logic but if you could post a few lines of the list.txt file and show me the intended output I am sure we could figure it out.
Correct on that I'm wanting to use a batch file to create additional batch files and text files. Essentially I have 121 specialized systems that I need to migrate from a routed network to a VLAN. Before I can change the IPs, I need to change the encryption keys.
To do so, I need to Telnet into each device, login to it, issue some special commands, then leave the connection open while sending another batch of commands from a central server. Once the commands from the central device are processed, then I can close out the remote connections.
So the inital batch file would read from list.csv
(list.txt & list.csv are the same file, just different extensions, both using a , for the delims. - I typo'd the original post)
Bldg 123 Rm 456,10.1.28.171
Bldg 789 Rm 12,10.1.50.20
and create
Bldg 123 Rm 456.bat and
Bldg 123 Rm456.txtBldg 123 Rm 456.bat would contain the following:
"tst10.exe /r:Bldg 123 Rm456.txt /o:bench.txt"
(note: /o:bench.txt is the output log of the tst10 program, but the log file itself isn't necessary for me to keep, though I believe the switch needs to be there)
and Bldg 123 Rm456.txt would contain:
10.1.28.171 20000
WAIT "username:"
SEND "name\m"
WAIT "password:"
SEND "pass\m"
WAIT ":"
SEND "command\m"
IP is the only thing that changes here. All other text is the same across all devices.
So in the end, I'd end up with 121 batch files, each with the TST10.exe shortcut/parameters, and 121 text files as the command script that will be executed on the remote devices.
I did look into Polyscript for this, but it didn't seem to work on the bench test. TST10 worked, so it looks like that's the route i'm going.