Skip to content

Instantly share code, notes, and snippets.

@LiamKarlMitchell
Created May 10, 2019 13:34
Show Gist options
  • Save LiamKarlMitchell/967f862bb40d27d117f136a23f35c364 to your computer and use it in GitHub Desktop.
Save LiamKarlMitchell/967f862bb40d27d117f136a23f35c364 to your computer and use it in GitHub Desktop.
Set location to current directory set path enviroment variable and start a shell Windows PowerShell if available otherwise cmd Command Prompt is used.
@echo off
cd /D "%~dp0"
title Your - Shell
set PATH="%~dp0Your\bin";%PATH%
REM Start powershell if available otherwise use cmd.
for %%i in (powershell.exe) do if "%%~$path:i"=="" (cmd) else start powershell -NoLogo -NoExit -Command "& { $env:Path = \"%PATH%\" }"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment