You can use the WScript.Shell object:
<font class="small">Code:</font><hr /><pre>//JScript
var wshShell = Sys.OleObject("WScript.Shell");
Log.Message("The used OS is: " + wshShell.ExpandEnvironmentStrings("%OS%"));
Actually there is no in-built environment variables in TestComplete like we have in QTP (Inbuilt and User Defined).
Actually while installation of QTP, QTP will recover inbuilt varibale values using COM, OLE etc objects ie. directly integrating with windows and store the values in QTP. So we can use these inbuilt varibales.
If we want any other varibale across all projects/tests, then we will create user-defined environment varibales and set the values via UI or Scripting.
But in TestComplete, we should create Project/ProjectSuite variables to get and set values across projects. Hope you got answer.
If I am wrong, please correct me.