Programmer's Cookbook

Recipes for the practical programmer

Sunday, February 12, 2006

 

Get Shared Windows Network Resources with Perl

The following code can be run on Windows using ActiveState's Perl. It will print data about each shared network resources on the machine.



use Win32::NetResource qw(:DEFAULT GetSharedResources);

if (GetSharedResources(my $resources, RESOURCETYPE_ANY,
{RemoteName => "\\\\" . Win32::NodeName()}))
{
foreach my $href (@$resources) {
print "-----\n";
foreach (keys %$href) {
print "$_: $href->{$_}\n";
}
}
}



Sample Output:

C:\>perl getresources.pl
-----
LocalName:
Scope: 2
DisplayType: 3
Type: 1
Provider: Microsoft Windows Network
Usage: 1
Comment:
RemoteName: \\RHANSON\outgoing



See also: Perldoc for Win32::NetResource

Comments:
Well you use a hard way for publishing, you could find much easier one!
python Training institute in Pune
python Training institute in Chennai
python Training institute in Bangalore

 
This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.. 
Best Devops online Training
Online DevOps Certification Course - Gangboard
Best Devops Training institute in Chennai

 
Useful Blog. the Blog is really very Impressive.I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.I really appreciate your method to explaining, I hope to see more posts from your blog. thank you!

Data Science Training In Chennai

Data Science Online Training In Chennai

Data Science Training In Bangalore

Data Science Training In Hyderabad

Data Science Training In Coimbatore

Data Science Training

Data Science Online Training


 


Great to become visiting your weblog once more, it has been a very long time for me. Pleasantly this article i've been sat tight for such a long time. I will require this post to add up to my task in the school, and it has identical subject along with your review. Much appreciated, great offer. data science course in nagpur

 
What a really awesome post this is. Truly, one of the best posts I've ever witnessed to see in my whole life. Wow, just keep it up.
data scientist training in malaysia


 
Really an awesome blog, with informative and knowledgeable content. Thanks for sharing this blog with us. Keep sharing more stuff again.
Data Science Certification in Hyderabad
 

I am truly getting a charge out of perusing your elegantly composed articles. It would seem that you burn through a ton of energy and time on your blog. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome.
data scientist training in hyderabad
 
This is a great inspiring article.I am pretty much pleased with your good work.
wedding photography packages
leather jacket
 
I think this is a really good article. You make this information interesting and engaging. You give readers a lot to think about and I appreciate that kind of writing.
data science training

 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?