code: private static Properties getWindowsShellVariables()
          throws EnvironmentException
      {
          Properties properties = new Properties();
          // build the command based on the shell used: cmd.exe or command.com
          StringBuffer buffer = new StringBuffer( getWindowsUserShell() );
          buffer.append( " /C SET" );
          String cmdExec = buffer.toString();
  
          int exitValue = readEnvironment( cmdExec, properties );
          if( 0 != exitValue )
          {
              String message = "Environment process failed with non-zero exit code of " + exitValue;
              throw new EnvironmentException( message );
          }
  
          return properties;
      }
docs: Adds a set of Windows variables to a set of properties.
  
  @return the environment properties
  
  @throws EnvironmentException if an error occurs