We help IT Professionals succeed at work.

URGENT: how do u list all shared folder of a computer???

foxhound
foxhound asked
on
this shouldn't be hard, but i cant find the code for it in vb!!!! i want to be able to list all the shared resource(or maybe even just folders) on a certain computer on a network, but even in different domains. Preferably address the computer with ip, since computer would be limited to just a certain domain/workgroup. I want the list to be in an array or list of some sort, not in one of those windows browser becoz i need the string itself of each folder path. this is urgent, thanks!
Comment
Watch Question

Commented:
Have you checked out www.planet-source-code.com, I believe if you search for something like "network", "nethood" or even "net shared" you should find what you are lookin' for.

Author

Commented:
I've checked but nothing, i need code that simply gives me a list of shared folders for a specific ip. 200 points
CERTIFIED EXPERT
Top Expert 2012

Commented:
Check these links out:

Enumerating Share Connection Information
http://www.mvps.org/vbnet/code/network/netconnectionenum.htm

Enumerating Shared Resources on Remote Machines
http://www.mvps.org/vbnet/code/network/netshareenum.htm

I believe it is what you are looking for.

Anthony
CERTIFIED EXPERT
Top Expert 2012

Commented:
Also, please maintain your many open questions.  For the record:

Questions Asked 43
Last 10 Grades Given A A A A A A A A A A  
Question Grading Record 17 Answers Graded / 31 Answers Received

Anthony

Author

Commented:
no, those does not do it, i've tried the code and it does not return me with a list of shared folders given a ip

and yes, i'm trying to clear those ungraded questions
thanks

You can achieve this using ADSI. Set references in your vb project to Active DS type library. The following Code gives the shared folder names of a particular machine.

    Dim obj
    Set obj = GetObject("WinNT://domainname/machinename/lanmanserver")
    For Each i In obj
            Debug.Print i.Name
            Debug.Print i.Class
    Next

Hope this helps.
Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, in the event new items have been created since this listing was pulled.

http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20129614.html
http://www.experts-exchange.com/questions/Q.20137917.html
http://www.experts-exchange.com/questions/Q.20139553.html
http://www.experts-exchange.com/questions/Q.20139820.html
http://www.experts-exchange.com/questions/Q.20140531.html
http://www.experts-exchange.com/questions/Q.20140543.html
http://www.experts-exchange.com/questions/Q.20140949.html
http://www.experts-exchange.com/questions/Q.20141688.html
http://www.experts-exchange.com/questions/Q.20143098.html
http://www.experts-exchange.com/questions/Q.20146578.html
http://www.experts-exchange.com/questions/Q.20174252.html
http://www.experts-exchange.com/questions/Q.20192563.html
http://www.experts-exchange.com/questions/Q.20196328.html


PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange


P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
to venkatg76
i was reading this thread cos i am trying to do a similar thing, and i tried your accepted anser, but when i don't know my lanmanserver, so i deleted that bit and ran it. it came up with an error message saying:
Run Time Error '-2147467259 (80004005)

Automation Error
Unknown Error

i am runnign windows 2000 (but the program is being designed to run on a win XP machine).
please help if you can.