I need to find a string in a file (easy enough) and set the line that the string was found in as a variable.
set comp=%@word[0,%@line[list1.txt,%counter]]
set comp2=%@word[1,%@line[list1.txt,%counter]]
set comp3=%@instr[5,14,[2,%@line[list1.txt,%counter]]
set comp4=%@word[2,%@line[list1.txt,%counter]]
reg query %comp\HKU > tempkey.txt <this is the command and the file I need to search a string in.
S-1-5-21-1960230475-814316877 is the string in can search and find , but the line number moves from 5 to 7 depending on which pc I search on.
set comp=%@word[0,%@line[list1.txt,%counter]]
set comp2=%@word[1,%@line[list1.txt,%counter]]
set comp3=%@instr[5,14,[2,%@line[list1.txt,%counter]]
set comp4=%@word[2,%@line[list1.txt,%counter]]
reg query %comp\HKU > tempkey.txt <this is the command and the file I need to search a string in.
S-1-5-21-1960230475-814316877 is the string in can search and find , but the line number moves from 5 to 7 depending on which pc I search on.