Thanks,
but I noticed that it does not work for foreign shares
using strComputer = "otherComputer"
How can this be achieved?
Main Topics
Browse All TopicsHello experts,
in my Visual Basic (VB6) program I need for a given computername and sharename
getting the comment related to that sharename.
\\mycomputer\myshare\...
I don't need to enumerate the network.
If anyone can help me,
please supply appropriate information.
Thank you for any help.
HStrix
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
That's probably due to a Firewall issue... The default setting for the built-in firewall for XP Service Pack 2 and beyond excludes remote administration. Run the following on the remote PC to configure the firewall:
netsh firewall set service RemoteAdmin enable
For additional information see: http://msdn.microsoft.com/
The OS on the computer is XP-Home SP2, the firewall is not running.I'm running ZoneAlarm Pro on it.
The OS on the other[virtual] computer is W2K SP4, it runs in a VM of VMware 5.5.1;
it accesses the internet through the XP-Home host.
And - as I said, using the neighborhood I can exchange data between both machines.
I checked more websites and I found a way:
http://www.activevb.de/tip
Here the API NetShareEnum is used to accomplish my target.
This API enumerates all shares on a computer
and returns my expected result.
It also works in XP-Home.
Unfortunately it doesn't seem to be possible
to get the result without any enumeration...
I don't understand either why this API is working,
and the solutions with WMI, ADSI and NetShareGetInfo API do not.
Business Accounts
Answer for Membership
by: grayePosted on 2006-07-14 at 11:31:45ID: 17110753
I'd consider using Windows Management Instrumentation (WMI)... http://msdn.microsoft.com/ library/de fault.asp? url=/libra ry/ en-us/w misdk/wmi/ win32_shar e.asp
---------- " ---------- "
Here is an example to demonstrate the concepts
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_Share",,48)
For Each objItem in colItems
Wscript.Echo "-------------------------
Wscript.Echo "Win32_Share instance"
Wscript.Echo "-------------------------
Wscript.Echo "AccessMask: " & objItem.AccessMask
Wscript.Echo "AllowMaximum: " & objItem.AllowMaximum
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "MaximumAllowed: " & objItem.MaximumAllowed
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Path: " & objItem.Path
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo "Type: " & objItem.Type
Next