You are in a web development the code that runs on the server side only has access to the PC where you are hosted
In the client is the browser that interprets html and javascript, if you need the environment variable of the client you should send it in the request that you make to the server.
Reading environment variables with Javascript
Javascript environment variables
There is always the alternative to try using
var ax = new ActiveXObject("wscript.shell");
assign the value in some hidden and send it in the post
But truthfully I would not recommend that you use ActiveXObject
this is no longer supported by many browsers
Remember that accessing information on the user's PC has security problems, that's why this thing you want to do would not be allowed