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