I am writing a batch script which I wish to open a file and then change the second line of it. I want to find the string ‘cat’ and replace it with a value that I have SET i.e. %var% . I only want this to happen on the second line (or for the first 3 times). How would you go about doing this?
Share
I just solve it myself. It will lookup var on line two only.
But I prefer using cscript (vbscript or even jscript).