With a poorly thought out regex...maybe it is good enough...
txt = runprogram(executable("net"), options({"use"}), readfunction("text"));
show(regex(txt,"U:[ \t]*([^ \t]*)","\1")); // find the "U:" drive
the txt value looks like this, before the regex
"New connections will be remembered.
Status Local Remote Network
-------------------------------------------------------------------------------
U: \\network\root\u\chales Microsoft Windows Network
The command completed successfully.
"
the regex captures this
Regex(txt, "U:[ \t]*([^ \t]*)", "\1") = "\\network\root\u\chales";
The 2nd argument to the regex is the pattern, which means
find U:, followed by zero or more blanks or tabs, then zero or more characters that are not blanks or tabs. That last bit is in parens, which form capture group \1, which is also the third argument that specifies what the result of the regex will be.
Craige