I have tried below command to append some path to system path variable by batch-file :
setx PATH \"%PATH%;C:\\Program Files\\MySQL\\MySQL Server 5.5\\bin\"
<
I faced the same problem when i tried to add path variables related to fortran (Eclipse for c/c++/fortran)
I tried SETX /M Path "%PATH%;C:\Users\mahidhai\cygwin64\bin" in command prompt as administrator .I got warning saying data was truncated to 1024 characters and stored .
SOlution: Go to registry file directly. Run->regedit Navigate to Environment
(Entire path : HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment )
Click on path registry and add the path variable directly. Or remove any repeated path variables .
Now , open command prompt and then run the same command setx /M path "%path%, "
Path variable could be related to C or C++ or fortran
No worries in editing registry file , it will be saved permanently , don't be afraid as environment variables are in session manager.