After some reseach, I found out that length limits for names are 255 and for values 32767 characters.
But which characters are allowed for names? And wh
seems that the only prohibited character is equal ("=") sign - https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx
The name of an environment variable cannot include an equal sign (=).