WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: kle2 on September 21, 2021, 12:35:03 PM

Title: share names and their directory paths?
Post by: kle2 on September 21, 2021, 12:35:03 PM
How do I retrieve all share names and their directory paths from Windows 2016 server? Thanks!
Title: Re: share names and their directory paths?
Post by: td on September 21, 2021, 01:12:11 PM
You can start with the documentation for the Network Extender. For example,

https://docs.winbatch.com/mergedProjects/Win32Network/WIN32NET_WSN060.htm (https://docs.winbatch.com/mergedProjects/Win32Network/WIN32NET_WSN060.htm)

The extender and its documentation come preinstalled with your WinBatch+Compiler distribution.

You can also search the Tech Database for more examples and even some other approaches.

Title: Re: share names and their directory paths?
Post by: kle2 on September 22, 2021, 04:32:36 AM
I am able to retrieve the share names with the command: list=wntShareList("\\SERVER", 1 | 16, 0)
How do I retrieve their directory paths/locations?

Thanks you!
Title: Re: share names and their directory paths?
Post by: td on September 22, 2021, 06:39:32 AM
You have the answer on your computer. Please review the wntShare* functions as documented in the Win32 Network Extender section of the Consolidated WIL Help file.
Title: Re: share names and their directory paths?
Post by: kle2 on September 22, 2021, 07:32:06 AM
I was able retrieve all shares and their directory paths with the powershell command get-smbshare.  Thanks
Title: Re: share names and their directory paths?
Post by: td on September 22, 2021, 08:26:00 AM
You could have done it with WinBatch by simply spending a couple of minutes with the help file. Apparently, that was too much work when, most likely, a PS cut and paste job was available. So be it.
Title: Re: share names and their directory paths?
Post by: kdmoyers on September 23, 2021, 12:50:37 PM
Mentally, I always assume there's an implied "Using Winbatch," in front of people's questions, but I guess that's not always true.  Make you wonder why they come here (of all places) and post the question.  No insult -- I bet there is a very good reason -- I'm just not sure what it is.
Title: Re: share names and their directory paths?
Post by: td on September 23, 2021, 01:42:29 PM
Marty had a theory about it... I am mostly amazed at the vagaries of the human response to problem-solving. Yesterday a WinBatch user contacted us to let us know that "XYZ security" company's network appliance was blocking our domain. That meant that anyone in the world on a corporate network using the device could not gain access to our sites. We thanked the individual for informing us of the problem but mentioned that there was little we could do about it since we are not a customer of XYZ. This prompted the user,  being a customer of XYZ to contact XYZ and requested they remove our domain from their block list.  The WinBatch user did this on their own without our prompting mind you. XYZ complied with the request almost immediately.

I guess some individuals take the approach that problems are there to be solved.
Title: Re: share names and their directory paths?
Post by: kdmoyers on September 23, 2021, 02:19:51 PM
There is much good going on in the world, and it often goes unnoticed.
Title: Re: share names and their directory paths?
Post by: stanl on September 24, 2021, 05:03:37 AM
Quote from: kdmoyers on September 23, 2021, 12:50:37 PM
Make you wonder why they come here (of all places) and post the question.


Good point, but perhaps bad circumstances. Outside the Json Extender threads, work Jim has been pursuing, some of the code I posted for Excel Power Query [which fell to deaf ears] a majority of the recent threads have been from newcomers to the forum, mostly with more general questions - i.e. "Does Winbatch work with Win 11"? Personally, I have always looked at this forum as a code exchange although some interesting more philosophical issues have been discussed.
Title: Re: share names and their directory paths?
Post by: JTaylor on September 24, 2021, 07:57:44 AM
I once ended up here looking for a C# solution, from a link in StackOverflow, just to discover the link was to a solution I had posted.  It is nice when you can answer your own questions :)

Jim
Title: Re: share names and their directory paths?
Post by: td on September 24, 2021, 12:14:28 PM
The moderation of this site has been more or less hands-off up til now.  The only request is to keep discussions centered around the title at the very top of the site home page. There is no shortage of sites for discussing almost anything you like so it is not asking too much to keep the topics WinBatch related.

Not sure what is meant by "philosophical issues" but suggesting that forum members be more specific with their questions is not a bad thing.  As a rule general questions get general answers and specific questions get more specific answers if there is an answer to be had. Often formulating a specific question will lead to the answer before it is even asked.
Title: Re: share names and their directory paths?
Post by: stanl on September 24, 2021, 12:48:04 PM
Quote from: td on September 24, 2021, 12:14:28 PM
Not sure what is meant by "philosophical issues"


just wanted to see if I could type it w/out spell check. Other forums have, or are, getting strict about user questions and their relevance. Having pulled the 'homework' card on several user posts, I can understand and endorse more moderation of this forum... saves some of us being pricks.