%PATHEXT%
contains a list of file extensions (with the corresponding dot) that are separated by a semicolon (as are the paths in %PATH%
). .COM
.EXE
.BAT
.CMD
.VBS
.VBE
.JS
.JSE
.WSF
.WSH
.MSC
PATHEXT
is used to start a program, batch file or script without explicitly specifying its suffix in cmd.exe
or its start
command. PATHEXT
in order for the script to be executed in the current console (rather than spawning a new console in which the script is executed). $env:PATHEXT
including "."
(extension-less files), PowerShell executes even associated console applications in a NEW console window), and
PATHEXT
in order for the script to be run in the same console).