This is the content of the conf file
use chroot = false
strict modes = false
hosts allow = *
log file = rsyncd.log
i need to add this two lines in the begin
uid=0
gid=0
and this other lines in the end
[data]
path = /cygdrive/d/My documents
read only = false
transfer logging = yes
[mail]
path = /cygdrive/d/mail
read only = false
transfer logging = yes
with the bat completed i will going to deploy it by policy on my network.
i´m really new in this, but i appreciate your help. Apologies for my english.
I tried with this code:
@echo off
Color 9A & Mode con cols=83 lines=5
Title %~n0 Adding lines to rsyncd.conf
:::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
:::::::::::::::::::::::::::::::::::::::::
REM --> Check for permissions
Reg query "HKU\S-1-5-19\Environment" >nul 2>&1
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
Echo.
ECHO **************************************
ECHO Running Admin shell... Please wait...
ECHO **************************************
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
set "hostspath=C:\Program Files (x86)\ICW\rsyncd.conf"
FIND /C /I "uid=0" "%hostspath%" >nul
FIND /C /I "gid=0" "%hostspath%" >nul
FIND /C /I "[data]" "%hostspath%" >nul
FIND /C /I "path = /cygdrive/d/My documents" "%hostspath%" >nul
FIND /C /I "read only = false" "%hostspath%" >nul
FIND /C /I "transfer logging = yes" "%hostspath%" >nul
FIND /C /I "[mail]" "%hostspath%" >nul
FIND /C /I "path = /cygdrive/d/mail" "%hostspath%" >nul
FIND /C /I "read only = false" "%hostspath%" >nul
FIND /C /I "transfer logging = yes" "%hostspath%" >nul
)
Attrib +R "%hostspath%"