in reply to
Windows Net Use
The output of "net use" is generally bad to parse. If your Windos is new enough (XP Pro) to include WMIC, the output of
WMIC NETUSE LIST FULL /FORMAT:CSV
should contain all that you need, and is much easier to parse. Only problem would be share names with commas in them, but for a reason unbeknownst to me, these are much rarer than those with embedded spaces :-)
There are several such command line utilities whose output is inconsistent or not parseable without mind reading capabilities. In such cases one should look for alternative sources of input.