https://bugs.winehq.org/show_bug.cgi?id=45810
--- Comment #2 from Aaron Simmons paleozogt@gmail.com --- This isn't just academic. I'm working on some tooling for using MSVC in Wine, along with other dev tools like Java/Python: https://github.com/paleozogt/MSVCDocker
The MSVC development environment puts quite a few things onto the PATH, which runs right up to the limit. Once I add other tools to it, it triggers this bug. I've had to put in a deliberate workaround for the problem here: https://github.com/paleozogt/MSVCDocker/blob/master/dockertools/vcwine#L15 otherwise it will fall down when the WINEPATH is too long and is ignored. The workaround is to just truncate the WINEPATH, but that of course breaks anything unfortunate enough to be past the limit.
btw, you mentioned setx, I don't see setx in Wine:
setx
Can't recognize 'setx' as an internal or external command, or batch script.
Is setx supposed to be there?