To list shares on a

To list shares on a server…create and run the following script.

SERVER=”<<your server name>>”
Set objFileShare=GetObject(“WinNT://” & SERVERNAME & “/Lanmanserver”)

objfileShare.filter=Array(“FileShare”)

For each FileShare in objFileShare
wscript.echo “Share Name:” & FileShare.Name & bvCRLF & “Path=” & Fileshare.Path
Next

This code snippet is from a great reference book. “Managing Enterprise Systems with the Windows Script Host”, A Press Publisher, ISBN# 1-893115-67-4

Leave a comment