Is there a consistent path to the latest installed version to use in a command?

I'm trying to add InteliJ as a mergetool and difftool to git, this requires commands like this to be executed:

.\idea.bat merge "A" "B" "C"

The problem is that I don't have a consistent path for that idea.bat file, currently it's

%appdata%\..\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\192.6817.14\bin\idea.bat

but that will probably change with the next version. I could also use the start menu shortcut:

%appdata%\Microsoft\Windows\Start Menu\Programs\JetBrains Toolbox\IntelliJ IDEA Ultimate.lnk

But that's not right either, this shouldn't be tied to how I decide to name my start menu entries. Is there a consistent path I can use? Or maybe an environment variable defined somewhere?

1

Please sign in to leave a comment.