MS DOS Snippets

December 15, 2020
 
MS DOS Code Snippets that I commonly looking for.
This is a simple list of MS DOS statements that I am using quite a bit and I'm always looking for examples when switching between all of the different scripting languages.
 
Echo off
@echo off
 
Get powershell version
powershell -command "[string]$PSVersionTable.PSVersion.Major +'.'+ [string]$PSVersionTable.PSVersion.Minor
 
If/Else
if errorlevel 1 (
echo Powershell is not installed. Please install it from download.Microsoft.com; thanks.
) else (
echo You have installed Powershell version:
)

 
Return to articles