@ECHO OFF

REM ### update sql installation path ###
SET regKey="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
SET regVal=Path
FOR /F "tokens=2*" %%i IN ('reg query %regKey% /v %regVal%') DO (  
    IF NOT "%%j" == "" (
        SET tmpPath=%%j
    )	
)
SET path=%path%;%tmpPath%

REM ### create folder permission ###
icacls "%cd%" /grant users:"(CI)(OI)F" >NUL