Skip to content

Instantly share code, notes, and snippets.

@Tcip
Created March 27, 2024 21:42
Show Gist options
  • Save Tcip/9401dcf8a93a61446de6b78e36cd86f2 to your computer and use it in GitHub Desktop.
Save Tcip/9401dcf8a93a61446de6b78e36cd86f2 to your computer and use it in GitHub Desktop.
echo Windows Edition using the PowerShell environment variable POWERSHELL_DISTRIBUTION_CHANNEL. This version store the data in a variable and then call it with echo command
@echo off
SET _we="%POWERSHELL_DISTRIBUTION_CHANNEL%"
FOR /F "tokens=* delims=MSI:" %%G IN (%_we%) DO SET _newvar=%%G
echo. %_newvar%
pause
@Tcip
Copy link
Author

Tcip commented Mar 27, 2024

echo Windows Edition (variable version).bat

echo the name of the installed Windows Edition (Home, Pro, Education, Enterprise, etc) using the PowerShell environment variable POWERSHELL_DISTRIBUTION_CHANNEL. This version store the data in a variable and then call it with echo command. None variable version can be found here.

echo Windows Edition bat
Screenshot from echo Windows Edition.bat. The output is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment