473,698 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shared folders.

Hello. How can I determine if a folder is shared? if it is shared, how can I
retrieve the resource shared name?

I have:
Folder name ==> C:\WORKS\DOCS
Resoure shared name ==> DOCUMENTS

With 'WNetOpenEnum() ' and 'WNetEnumResour ce()' I can get '\\MYPC\DOCUMEN TS'
but there is not relation with real name folder.

Thanks in advance,
William GS
Nov 17 '05 #1
5 1346
You can use SHGetFileInfo and look at the attributes in the SHFILEINFO
object. If SFGAO_SHARE is set then the file or folder or device is shared.

Tom

"William GS" <Wi*******@disc ussions.microso ft.com> wrote in message
news:65******** *************** ***********@mic rosoft.com...
Hello. How can I determine if a folder is shared? if it is shared, how can
I
retrieve the resource shared name?

I have:
Folder name ==> C:\WORKS\DOCS
Resoure shared name ==> DOCUMENTS

With 'WNetOpenEnum() ' and 'WNetEnumResour ce()' I can get
'\\MYPC\DOCUMEN TS'
but there is not relation with real name folder.

Thanks in advance,
William GS

Nov 17 '05 #2
William,
Hello. How can I determine if a folder is shared? if it is shared, how can
I
retrieve the resource shared name?

I have:
Folder name ==> C:\WORKS\DOCS
Resoure shared name ==> DOCUMENTS

With 'WNetOpenEnum() ' and 'WNetEnumResour ce()' I can get
'\\MYPC\DOCUMEN TS'
but there is not relation with real name folder.


Having the shared name you can get the local folder path using
NetShareGetInfo (), but more useful in your case is WNetGetUniversa lName(),
which can do the opposite. Here's an example of NetShareGetInfo (), btw:
http://win32.mvps.org/network/nsgi.cpp

--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Nov 17 '05 #3
Hi Tomas, it works fine in Win2000/XP, but I need it in Win98/ME too.
'NetShareGetInf o()' in linked to 'netapi32.lib' in NT/XP and 'svrapi.lib' in
98/ME, 'NetApiBufferFr ee()' is linked to 'netapi32.lib'.

My app compiles fine in Win98, but it searches 'NetShareGetInf o()' in
netapi32.dll and my app does not run.

Please, some advice to solve this.
Thansk in advance.
William GS
"Tomas Restrepo (MVP)" wrote:
William,
Hello. How can I determine if a folder is shared? if it is shared, how can
I
retrieve the resource shared name?

I have:
Folder name ==> C:\WORKS\DOCS
Resoure shared name ==> DOCUMENTS

With 'WNetOpenEnum() ' and 'WNetEnumResour ce()' I can get
'\\MYPC\DOCUMEN TS'
but there is not relation with real name folder.


Having the shared name you can get the local folder path using
NetShareGetInfo (), but more useful in your case is WNetGetUniversa lName(),
which can do the opposite. Here's an example of NetShareGetInfo (), btw:
http://win32.mvps.org/network/nsgi.cpp

--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/

Nov 17 '05 #4
William,
Hi Tomas, it works fine in Win2000/XP, but I need it in Win98/ME too.
'NetShareGetInf o()' in linked to 'netapi32.lib' in NT/XP and 'svrapi.lib'
in
98/ME, 'NetApiBufferFr ee()' is linked to 'netapi32.lib'.

My app compiles fine in Win98, but it searches 'NetShareGetInf o()' in
netapi32.dll and my app does not run.


Check http://win32.mvps.org/network/net_win9x.html
and
http://msdn.microsoft.com/library/de..._95_98_me_.asp
--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
Nov 17 '05 #5
Thank you so much :-)

William GS
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1614
by: Glenn Venzke | last post by:
I have several folders on a test web server that are not visible in the directory structures of several programs, including Visual Interdev and Stac ReachOut. All these folders have one thing in common: they are shared. I tried turning sharing off to fix the problem - no good. The only way to make these folders visible to my project is to manually add them. But every time I refresh my project view, the folders go back to not being visible...
5
1974
by: Dan Lorenz | last post by:
When trying to use the function CreateDirectory on my local machine everything works fine but when I upload the page to my webhost I get an issue that it can't find path on D:\, though D:\ is what my website is found on. This is an H-SPHERE web cluster host. From my research I found that this issue is due to ASPNET account not having read previdgeles on the root of the drive. My question is what is the correct approach to solve this...
0
2352
by: Dennis | last post by:
I have tried to use the IWshRuntimeLibrary and ManagementObjectSearcher("SELECT * FROM Win32_LogicalDisk") to get all Logical Drives, Mapped Network Drives, Shared Folders and Shared Drives with limited Success because there is a bug apparently in using IWshRuntimeLibrary. There must be some API calls to get this information since Windows Explorer seems to be able to get. Can anyone tell me what API's are used. I know GetLogicalDrivesA...
1
1274
by: nuggies | last post by:
I'm developing an ASP.NET 2.0 (C#) application in which I need to display the available shared folders on the server. The shared folder paths need to be in UNC format (i.e., \\servername\share) and need to be clickable links. Upon clicking the link a textbox needs to be populated with the full UNC path. I don't need to read, write, edit, delete, etc. files or folders, I simply need to list all the shared folders and get its full UNC...
3
26481
by: sva | last post by:
Using C# for an application in which I am working on, I need to display the available shared folders on the computer that's running the application. The shared folder paths need to be in UNC format (i.e., \\servername\share). I don't need to read, write, edit, delete, etc. any files or folders, I simply need to get a list of all the shared folders and get their full UNC path. I know the System.IO namespace has some methods and/or...
1
2901
by: lecnac | last post by:
Here's some details: Server and workstation both in the same workgroup Logged into server as local Administrator Logged into workstation as a local user that is only in the Users group The local user on the workstation is also defined with same name and password on the server (and only in the Users group on the server) Server is Windows Server 2003 running IIS 6.0 Workstation is Windows XP Professional ASP.NET 2.0 (C#) web site
1
3700
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is quickly becoming more and more urgent. I've tried the code below using the server's local Administrator user name and password. This gets me past the Access denied error but gives me a User
0
4475
by: NoWhereMan | last post by:
Hello, I'm trying to get the list of shared folders of a network computer and add them to a combo box. I'm using the bellow code in VB .NET. Code ==== Private Sub EnumShares(ByVal Machine As String) 'Local Shares Try Dim scope As String = ("\\" & Machine & "\root\cimv2") Dim SharesClass As ManagementClass = New ManagementClass(scope, "Win32_Share", Nothing)
2
9667
by: Daniel Knöpfel | last post by:
Hi In my application i need to do the following things concerning shared folders: - check if a folder is shared - share a folder - unshare a folder It seems to me that .net does not support this by default. Is there a way to
14
10264
by: Betray | last post by:
We have a AD running on win2k3. We have many shared folders. Ive noticed that once in a while users will call up and report the folders missing. To fix the issue i would reboot the system. And vola files visable to all users. Just recently i found another soloution and that was to disconnect all users on the shared folders in my admin panel. Again, vola users can see the folders! What kinda issue is this? Seems like when to many users try to...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8862
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.