Author Topic: share names and their directory paths?  (Read 196 times)

kle2

  • Newbie
  • *
  • Posts: 16
share names and their directory paths?
« on: September 21, 2021, 12:35:03 pm »
How do I retrieve all share names and their directory paths from Windows 2016 server? Thanks!

td

  • Tech Support
  • *****
  • Posts: 3872
    • WinBatch
Re: share names and their directory paths?
« Reply #1 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

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.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kle2

  • Newbie
  • *
  • Posts: 16
Re: share names and their directory paths?
« Reply #2 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!

td

  • Tech Support
  • *****
  • Posts: 3872
    • WinBatch
Re: share names and their directory paths?
« Reply #3 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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kle2

  • Newbie
  • *
  • Posts: 16
Re: share names and their directory paths?
« Reply #4 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

td

  • Tech Support
  • *****
  • Posts: 3872
    • WinBatch
Re: share names and their directory paths?
« Reply #5 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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kdmoyers

  • Sr. Member
  • ****
  • Posts: 427
Re: share names and their directory paths?
« Reply #6 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.
The mind is everything; What you think, you become.

td

  • Tech Support
  • *****
  • Posts: 3872
    • WinBatch
Re: share names and their directory paths?
« Reply #7 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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kdmoyers

  • Sr. Member
  • ****
  • Posts: 427
Re: share names and their directory paths?
« Reply #8 on: September 23, 2021, 02:19:51 pm »
There is much good going on in the world, and it often goes unnoticed.
The mind is everything; What you think, you become.

stanl

  • Pundit
  • *****
  • Posts: 1534
Re: share names and their directory paths?
« Reply #9 on: September 24, 2021, 05:03:37 am »
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.

JTaylor

  • Pundit
  • *****
  • Posts: 1717
    • Data & Stuff Inc.
Re: share names and their directory paths?
« Reply #10 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

td

  • Tech Support
  • *****
  • Posts: 3872
    • WinBatch
Re: share names and their directory paths?
« Reply #11 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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

stanl

  • Pundit
  • *****
  • Posts: 1534
Re: share names and their directory paths?
« Reply #12 on: September 24, 2021, 12:48:04 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.