Batch-File Use of asterisks (*) in a variable
14:56 22 Oct 2026

I've been needing to be able to echo the output of the first section of a variable string, and the second, on another line. Obviously, the first step would be to use some system to read variable contents until the presence of a specific character, then saving the lines separately. I heard of a way to do this similarly to set "var=%var:*=%? I don't remember the correct syntax, and that example is probably way off, but I do believe it used an asterisk (*).

Scenario:

sectionOne_sectionTwo, with (_) being the separation character. If you stored both sides in their own variables, and printed them on separate lines, this could be the output:

sectionOne
sectionTwo

Does anyone know how this would work?

batch-file