I have scripted OLCNS.BAT to output, in CSV format, the offline cache settings for my shares, by parsing the output of the net share command.

The syntax for using OLCNS.BAT is:


Output is displayed on the console in the following format:

<b>"Share Name","File System Path","Cache Setting"</b>

Where <b>Cache Setting</b> can be one of the following:

<b>Manual caching of documents</b>
<b>Automatic caching of documents</b>
<b>Automatic caching of programs and documents</b>
<b>Caching disabled</b>.
OLCNS.BAT contains:
@echo off
set f1=Findstr /l /n /v /c:"<a href="/article/tips/jsi-tip-9936-how-can-i-output-in-csv-format-the-offline-cache-settings-for-my-shares-using-the-net-share-command--84763?topic=*%24">*$</a>"
set f2=Find /V "The command completed successfully."
for /f "Skip=4 Tokens=1* Delims=:" %%a in ('net share ^|%f1%^|%f2%') do (
 set line=%%b
 if "!line:~0,1!" NEQ " " call :parse %%b
goto :EOF
if "%1" EQU "" goto :EOF
set sn=%1
set sp=
set cc=
call :parse1 %1
if "%sp%" EQU "" goto :EOF
if "%cc%" EQU "" goto :EOF
if "%sp:~1,1%" NEQ ":" goto :EOF
@echo "%sn%","%sp%","%cc%"
goto :EOF
for /f "Tokens=*" %%x in ('net share %1') do (
 set line=%%x
 if "!line:~0,18!" EQU "Path              " set sp=!line:~18!
 if "!line:~0,18!" EQU "Caching           " set cc=!line:~18!