Thursday, January 18, 2018

#1 2003-04-14 03:58:22 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

How can I have list of shares on a machine into a text file?

I need the ability to have a file or files with the list of avaliable shares on three machines so that I can search for a specific share at anytime without having to interigate each machine everytime. The only time  I have seen this type of list is like the one that appears when you connect to a machine via "Go to server" or Chooser. Is this possible???

One mans trash is another mans treasure



#2 2003-04-21 12:21:54 pm

From:: San Jose, CA
Registered: 2002-12-15
Posts: 629

Re: How can I have list of shares on a machine into a text file?

This might get you started.

Using niutil, you can extract most of the configuration options of your system, including shares. It's just a matter of knowing what parts to ask for.

In this case:

do shell script "niutil -list . /config/SharePoints"


do shell script "niutil -list . /exports"

will each give you a list of shares.

You can either call this dynamically (it's pretty lightweight), or save the output into a text file for later reading. The dynamic option has the advantage that it'll never be out of date with how the system is configured.

From a scripting point of view, one line of 'do shell script' isn't a lot different from one line of 'read file'.



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)