Shell command not working after switching to Windows Terminal as default

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kriegaex
Posts: 1
Joined: 26 Sep 2021, 03:10

Shell command not working after switching to Windows Terminal as default

Post by kriegaex » 08 Dec 2023, 23:30

I activated Windows Terminal as the default terminal application. I.e., also when starting cmd.exe, Windows Terminal is opened. Since I did that, my macro starting a Java application no longer works. As soon as I change WT settings back to console host as the default, it works again. The crucial part of macro is:

Code: Select all

RunWait %comspec% /c "java -Dfile.encoding=UTF-8 -jar "%JAR%" "%TEMP_FILE%" > "%TEMP_FILE%.x""
If I change "%comspec%" to "wt.exe", it works. But I am auto-syncing my AHK scripts to several computers via cloud storage, and not all of them might have wt.exe installed. Is there any way to create the RunWait command in such a way that it works regardless of the default terminal cmd.exe or wt.exe? I am not expecting it to work in other shells such as PowerShell or Git Bash.

Return to “Ask for Help (v1)”