<http://www.netikka.net/tsneti/info/tscmd111.htm>
Copyright © 2003-2010 by Prof. Timo Salmi  
Last modified Sat 15-May-2010 17:27:04

 
Assorted NT/2000/XP/.. CMD.EXE Script Tricks
From the html version of the tscmd.zip 1cmdfaq.txt file
To the Description and the Index
 

This page is edited from the 1cmdfaq.txt faq-file contained in my tscmd.zip command line interface (CLI) collection. That zipped file has much additional material, including a number of detached .cmd script files. It is recommended that you also get the zipped version as a companion.

Please see "The Description and the Index page" for the conditions of usage and other such information.



111} How can I detect if a folder is shared or not?

The same method as in the previous item can be used e.g. to check if a folder is shared or not.
  @echo off & setlocal enableextensions
  set find_=C:\_M
  net share|find /i "%find_% ">nul
  if %errorlevel% EQU 0 (
    echo Folder "%find_%" is shared
    ) else (
    echo Folder "%find_%" is not shared or does not exist)
  endlocal & goto :EOF

References/Comments:
  net share