What is the best way to set the path to julia on Windows 10?

I just kludged together the following power shell script which may be helpful.

The idea is that you put it in a project folder and can run julia with that folder as the working directory just by double clicking the script file. It automatically finds and uses the latest installed version of julia.

$host.ui.RawUI.WindowTitle = "Julia"

# Use the script directory as the initial working directory
cd $PSScriptRoot

# Find the latest installed version of Julia
$jlpath = dir -Path $Env:LOCALAPPDATA/Julia-* | sort -Property FullName | Select-Object -Last 1 | Join-Path -ChildPath "bin\julia.exe"

# Use current directory as the project directory.
# You may want to remove the --project
iex "$jlpath --project=."

side note… coming from knowing bash quite well, powershell sure is unusual. But ever so much saner than .bat files.

4 Likes