What would be my best option if I wanted to create a batch that would take a list of IP addresses(text file maybe?), and generate the following:
edit "Mal-ip *"
Set associated-interface ''
Set color 0
Set comment ''
Set visibility enable
Set subnet * 255.255.255.255
next
I'd like it to take a list of IPs and replace the * with the IP address, either by line or easiest method? This is for generating a command to add multiple ips to a block list via cli. Currently I have a text file I have to add each ip individually.. Would like to automate this if possible to speed up the process. I'm not asking for anyone to provide me the code but rather point me in the right direction or some example links.. Or if there's a better way to do this I'm open to suggestions. Thanks!!
Suggestions?
Moderator: DosItHelp
Re: Suggestions?
If the task is to replace two * with an IP address on each line in a text file - this is easy (but untested):
Code: Select all
@echo off
(
for /f "usebackq delims=" %%a in ("c:\folder\IPlistfile.txt") do (
echo(edit "Mal-ip %%a"
echo( Set associated-interface ''
echo( Set color 0
echo( Set comment ''
echo( Set visibility enable
echo( Set subnet %%a 255.255.255.255
echo(next
echo(
)
)>"newfile.txt"