@Echo Off

set curdir1=%~DP0
set curdir=%curdir1:~0,-1%
echo %curdir%

Set sw="HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
For /F "tokens=2*" %%j In ('Reg Query %sw% /v Path ^| Find /I "Path"') Do Set type=%%j& Set curpath=%%k
Echo "%curpath%" | Find /I "%curdir%" >Nul && GoTo :EOF
set newpath=%curpath%;%curdir%
Reg Add %sw% /v Path /t %type% /d "%newpath%" /f
