I think that your problem is that the "english readable" error isn't being produced by "net". It's comming from someplace else (the OS). If you redirect STDERR, you'll see that STDERR from the call to net is not the "english readable" message. I'm testing this on 2000, so I can't verify the results on NT. Here's my results.
#!/usr/bin/perl -w
use strict;
my $results = `net use f: \\\\SERVER\\c\$ 2>&1`;
print "results contains - $results\n";
results -
C:\dev>map.pl
results contains - System error 1202 has occurred.
An attempt was made to remember a device that had previously been reme
+mbered.
On NT, your whole error message may be in STDERR. It's not in 2000 though.
Hope this helps..
Rich
update: I'm an idiot. The entire message is in $results. So forget I mentioned that the whole thing wasn't sent to STDERR. I assumed it wasn't because of the new lines. I guess that's what I get for thinking! :)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.