hidden shares





4
Date Submitted Thu. Mar. 2nd, 2006 3:41 AM
Revision 1 of 1
Syntax Master dannyboy
Tags "Command Line" | BATCH | CMD | share
Comments 0 comments
Builds a batch file to create hidden shares for a bunch of sub-directories (eg, User shares)

@echo off
if "%2"=="" goto usage
if not exist %1 goto nodir
del /Q %2
for /f %%a in ('dir /s /a:d /b %1') do echo NET SHARE "%%~nxa$"=%%a>>%2
echo.
echo Output file %2 created. Run this to create the shares
echo.
goto end

:usage
echo.
echo %0
echo    Usage: %0 startdir outputfile
echo.
goto end

:nodir
echo.
echo %0
echo    Start directory "%1" does not exist.
echo.

:end
 

Comments

There are currently no comments for this snippet.

Voting