As I wrote in the initial description, I did this to check a group of computers, not all "visible" computers on the network.
I wrote this little thing to save me from manually having to browse the computers for shares. Learning about the topic and writing it took longer than it would have taken to manually check the computers. But next time I want to check some computers it's just a matter of seconds to alter and run it. The ARGV bit also makes it possible to simply run
sharescheck.pl computer1 computer7 server_A laptopBOB
Does anyone really use the LMHOSTS file? Maybe for small internal networks with few (Windows) computers, but otherwise I think it's better managed by a Domain Controller (and with DHCP/WINS). It would be better to ask the "Windows network" about its resources than to check a local file whose validity you can't be sure of.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.