i have a batch file that reads one-line strings and sends them to a subroutine. i would…
- User
i have a batch file that reads one-line strings and sends them to a subroutine. i would like to send to subroutine A if the string contains the expression "anywhere.com" and to subroutine B if it does not. can i do this in windows batch?
Assistant
Yes, you can do this in Windows batch using the
findstrcommand or string substitution. Here are two approaches:Method 1: Using findstr (recommended)
batch
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.