setx PATH "c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%"
Do not suggest using it. https://openframeworks.cc/setup/msys2/ https://github.com/openframeworks/openFrameworks/blob/master/docs/msys2.md
C:\Users\Asus-PC>setx PATH "c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%"
WARNING: The data being saved is truncated to 1024 characters.
SUCCESS: Specified value was saved.
It takes HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment Path and Computer\HKEY_CURRENT_USER\Environment Path together as %PATH%, truncates it to 1024 characters and set it to Computer\HKEY_CURRENT_USER\Environment. In other words it deletes the user paths rewriting it with truncated system ones. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/setx#remarks
Better rewrite it with commands suggested here: https://superuser.com/questions/387619/overcoming-the-1024-character-limit-with-setx https://stackoverflow.com/questions/17240725/setx-doesnt-append-path-to-system-path-variable
Or edit Computer\HKEY_CURRENT_USER\Environment directly.
If one do not close CMD after running setx PATH "c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%" they can get the previous paths by running echo %PATH% or set.
Also edited directly paths update on interacting with Windows's Edit the system environment variables -> Environment Variables -> Edit environment variable hitting OK.