How to Create Folder, Share Folder and Permission Using Batch File

1. Type call, 1userdir.bat and user name 3 teacher bellow and save as batch file, say userdir.bat
____________________________________
CALL 1USERDIR.BAT AFZAM
CALL 1USERDIR.BAT IDAH
CALL 1USERDIR.BAT NOORANIS

__________________________

2. Type one more batch file contain information about create folders, share folders and permission folder to user and admin (pentadbir). Save this file, say 1USER1DIR.BAT.

_____________________________________________________________
md F:\GURU\DATA\%1

rmtshare \\dea2191si001\%1 = f:\GURU\DATA\%1 /GRANT "dea2191\pentadbir":f /GRANT "dea2191\%1":f

xcacls F:\GURU\DATA\%1 /e /g pentadbir:f %1:f /r everyone
______________________________________________________


Note:

F - partition

GURU\DATA - Guru - folder, data is sub folder to guru
Dea2191 - domain name of server (application server)
md F:\GURU\DATA\%1
- create folder to 3 teachers, %1 - variable for teacher.
Second line - create shared permission to teachers and give full permission(f) to admin and teacher.
Third line - create folder permission to teacher/user and admin. remove permission to everybody.

3. Download mtshare.exe, xcalcs.exe, user.exe and example of users.csv, 1userdir.bat, userdir.bat and users.bat from this link.
4. Click start button, type cmd in the search program and file's box.
6. Command window appear. Type directory and folder where you keep mtshare.exe and xcalcs.exe program and userdir.bat, 1userdir.bat file.

7. Type userdir.bat in the command prompt.
execute batch userdir.bat file.

Folder was created, 2 of 3 teacher.

Folder was shared and permission was given to admin and that teacher.
Permission folder was given to admin and that teacher.

.... I have done to NT and 2008 R2 server. So easy.



Comments

zakaria said…
okla cgu pa buat banyak-banyak soalan
zakaria said…
buat hok frm 4 and frm 5 lagi baik

Popular posts from this blog

How to Install ‘IPFire’ Free Firewall Linux Distribution

Installing Moodle on a Debian-based LAMP server

Step by Step Installasi Mikrotik Router x86 pada ProxMox 3.2 Virtual Server