Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Windows Net Use

by Anonymous Monk
on Mar 28, 2013 at 11:22 UTC ( #1025943=note: print w/replies, xml ) Need Help??

in reply to Re: Windows Net Use
in thread Windows Net Use

Parsing the output of WMIC looks even more difficult , cause its output is very different as compared to net use. So If u could tell me how to parse it or break it into what i need, it would be a great help..

Replies are listed 'Best First'.
Re^3: Windows Net Use
by marto (Bishop) on Mar 28, 2013 at 11:34 UTC

    The suggested code will return the information in CSV format. Save it to a file and use something like Text::CSV to read only the columns you want.

    Update: use something like /output:c:\netuselist.csv to save the file.

Re^3: Windows Net Use
by soonix (Monsignor) on Mar 28, 2013 at 16:48 UTC

    For the human eye it looks more gibberish, but for parsing it is less error prone.

    As marto already pointed out, the best solution is Text::CSV. Since CSV means "comma separated values", the second best is splitting on the commas.

    The first line that WMIC outputs, BTW, contains the field names.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025943]
[marto]: My German is very limited and Google translate really isn't helping with that one :P
[erix]: my "Jeschwätz von jestern" = "Geschwätz von gestern" = "my babbling of yesterday"

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-01-19 13:42 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (218 votes). Check out past polls.