Skip to main content

This Windows batch script example shows you how to add a path to the %PATH% environment variable (includes existence check).

@echo off
pushd %~dp0

rem The new build environment should include MSBuild 15 and .NET Core 1.1 tools
rem powershell.exe -File InstallCoreSDK.ps1

echo %PATH% | findstr /I /C:"C:\Program Files\dotnet" >NUL 2>NUL
if %ERRORLEVEL% neq 0 set PATH=%PATH%;C:\Program Files\dotnet\

popd