I wrote a manual for non-sip003 standard plugin usage.
Please merge to the wiki page.
Sourcecode: https://gist.github.com/chenshaoju/9796bb4783b81f64d718065801b085ca
No copyright, Feel free to use or modify it.
Thanks.
@chenshaoju have you tried this? if not, please test it!
@colalan I used plugin is SIP003 standard, so I only tested with cmd.exe, use c:\windows\system32\cmd.exe and /c echo %SS_REMOTE_HOST% >d:\test.txt to test environment variables is working or not.
I will try kctpun as sample.
@chenshaoju please use non-sip003 test
Interesting, If using Shadowsocks for Windows, it will not work, kcptun process will keep restart.
But if I set the same config with environment variables manually, It can work.
I think the document is all right, but some wrong in this process.
For cautiously, I have changed the title.
I think I know what happens here.
Shadowsocks for Windows directly give these environment variables name to the plugin.

Unfortunately, It's will not work, the plugin usual is unable to process these environment variables.
But these environment variables can pass by cmd.exe, If I set Plugin Program is:
C:\Windows\system32\cmd.exe
And set Plugin Arguments is:
/c D:\Shadowsocks\client_windows_amd64.exe -l %SS_LOCAL_HOST%:%SS_LOCAL_PORT% -r %SS_REMOTE_HOST%:%SS_REMOTE_PORT% --key 123456 --crypt salsa20 --mode fast2
It's can work.

https://github.com/shadowsocks/shadowsocks-windows/pull/1818
大概知道为什么有问题了,简单的说,cmd才会解释环境变量。
Will be merged in next release
Thanks for your work!