One can obtain the Windows Terminal's version by running the command wt -v
, which results in a message box being displayed as such:
Is it possible to obtain this version string programmatically using (preferrably) a .NET language such as C#? (solutions using C/C++ are also acceptable for my scenario).
For now, I am currently resolving the issue as follows (thanks to Andrew Morton and Sinatr for their comments):
HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\wt.exe
(Default)
. This is usually something along the lines of C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.21.3231.0_x64__8wekyb3d8bbwe\wt.exe
.wt.exe
or WindowsTerminal.exe
inside of the current process tree. (Results are only included if the executable resides in a sub-directory of %ProgramFiles%\WindowsApps
to avoid false positives.)string version_string = FileVersionInfo.GetVersionInfo(path).FileVersion;
(\d+\.){3}\d+
).Version
using Version.TryParse
.I am not happy with that solution and I'd be glad to accept a more 'official' way to extract the version number, but this works for me at the moment.