How to resolve the algorithm Environment variables step by step in the M2000 Interpreter programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Environment variables step by step in the M2000 Interpreter programming language

Table of Contents

Problem Statement

Show how to get one of your process's environment variables. The available variables vary by system;   some of the common ones available on Unix include:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Environment variables step by step in the M2000 Interpreter programming language

Source code in the m2000 programming language

Module CheckIt {
      \\ using read only variablles
      Print "Platform: ";Platform$
      Print "Computer Os: "; Os$
      Print "Type of OS: ";OsBit;" bit"
      Print "Computer Name:";  Computer$
      Print "User Name: "; User.Name$
      \\ using WScript.Shell
      Declare objShell "WScript.Shell"
      With  objShell, "Environment" set env ("Process")
      With env, "item" as Env$()
      Print Env$("PATH")
      Print Env$("HOMEPATH")
      Declare objShell Nothing
      \\ using internal Information object
      Declare OsInfo INFORMATION
      With OsInfo, "build" as build, "NtDllVersion" as NtDllVersion$
      Method OsInfo, "GetCurrentProcessSID" as PID$
      Method OsInfo, "IsProcessElevated" as isElevated
      Print "Os build number: ";build
      Print "Nr Dll version: ";NtDllVersion$
      Print "ProcessSID: ";pid$
      Print "Is Process Eleveted: ";isElevated
      Declare OsInfo Nothing
}
Checkit

  

You may also check:How to resolve the algorithm Monty Hall problem step by step in the Io programming language
You may also check:How to resolve the algorithm Even or odd step by step in the M4 programming language
You may also check:How to resolve the algorithm Date format step by step in the HicEst programming language
You may also check:How to resolve the algorithm String concatenation step by step in the VBScript programming language
You may also check:How to resolve the algorithm Metered concurrency step by step in the Rust programming language