Dos

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

XCACLS don't work on Win2k8 ny more so use icacls for giving folder permissions.

For /f %i IN (E:\serverlist.txt) DO ICACLS \\%i\e$\test /t /grant "ADCTR-MTSRV":


F "ADCTR-UISRV":F
but this will give special permission
To grant full control without special permission in "security" try :-
For /f %i IN (E:\serverlist.txt) DO ICACLS \\%i\e$\APILog /t /grant :r "ADCTR-MT
SRV":(OI)(CI)F "ADCTR-UISRV":(OI)(CI)F "Network Service":(OI)(CI)F

To remove user :-
For /f %i IN (E:\serverlist.txt) DO ICACLS \\%i\e$\APILog /t /remove "ADCTR-MTSR
V" "ADCTR-UISRV" "Network Service"
For sharing folder:-
For /f %i IN (E:\serverlist.txt) DO RMTSHARE \\%i\EvdServiceLogs = e:\EvdService
Logs /GRANT "ADCTR-MTSRV":FULL /GRANT "ADCTR-UISRV":FULL /GRANT "Network Service
":FULL
To only grant "share" permission to ALREADY shared folder :-
For /f %i IN (E:\serverlist.txt) DO RMTSHARE \\%i\APILog /GRANT "ADCTR-MTSRV":FU
LL /GRANT "ADCTR-UISRV":FULL /GRANT "Network Service":FULL
To add users in local admin group :-
for /f %i in (E:\serverlist.txt) do psexec \\%i net localgroup administrators ph
x\sachinko /add PHX\pramanju /add
for /f %i in (E:\serverlist.txt) do start psexec \\%i net localgroup administrat
ors phx\sachinko /add PHX\pramanju /add

For any cmd error "net helpmsg <error no>" is the solution

To install program remotely :- in cmd prompt type "wmic" then paste


/node:@"C:\Users\v-gabans\Documents\serverlist.txt" product call install true,"
" , "E:\dn4.exe"

You might also like