killme said:
Use a script (batch\vbscript) to create the share and set the permissions
[SNIP]
I want to be able to do this from within Explorer. Doing a batch would mean
doing it all at once, but I add shares throughout the week and if I could
change the default permissions as the share is created then I wouldn't have
to do it manually after every share I create. Using a script would still
mean me having to type out the permissions and the shares to create and I
would have to do it each time I created a share.
Hi
No, you can create a vbscript or batch file that supports "drag-and-drop" from
Explorer so the only thing you need to is type in the share name the script
asks for. If your share name is always the folder name or the folder name with
$ behind, you can even let the vbscript or the batch file extract the last
folder name from the path that was sent as input to the script (or you can have
two scripts, one that asks for the share name and one that extracts it).
So if you place this script on the desktop, you just drag the folder up on the
file and you will be asked for the share name (if it is not created
automatically), or even better put the script in the SendTo folder, so you can
just right click on the folder and use the 'Send To' menu entry. More easy than
that you can't create a share (unless you get someone else to do the job for
you ;-)
I have created a batch file for you that support the folder as input parameter
(drag and drop/Send To), and asks for a share name when activated. It uses
RMTSHARE.EXE to create the share and set the current user to have FULL control
(Everyone none). The script will list the result before it ends.
Download RMTSHAR.EXE from here and unpack it:
ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/
If you don't put RMTSHARE.EXE in the path (e.g. in the windows folder), you
need to hard code the path to RMTSHARE.EXE in the batch file below (two
places).
Here is CreateShare.bat (I have tested it on Windows XP):
@echo off
echo.
set /p ShareName=Enter share name:
echo.
@echo on
RMTSHARE.EXE \\%COMPUTERNAME%\"%ShareName%"=%1 /GRANT %USERNAME%:f
@echo off
echo.
echo.
RMTSHARE.EXE \\%COMPUTERNAME%\"%ShareName%"
echo.
pause
If the folder is on a remote server, you will need to substitute
%COMPUTERNAME%, and if the %USERNAME% doesn't work, you might need to change it
to %USERDOMAIN%\%USERNAME%