cherieodu
cherieodu

Reputation: 53

How do I run a Windows Terminal command from a shortcut?

The same way you can echo "hello world" on cmd by creating a shortcut using "C:\Windows\System32\cmd.exe" /k echo hello world, how can I do the same with Windows Terminal? Swapping the cmd file location with the wt file location doesn't work. It says "/k was not expected."

Upvotes: 2

Views: 2605

Answers (2)

ElectricErger
ElectricErger

Reputation: 93

Microsoft PowerToys 0.79.0 has introduced the ability to remap shortcuts to launch applications in its Keyboard Manager tool.

Keep in mind you'll need to type in the path manually since the browser has issues accessing the "WindowsApps" folder it installs into. %LocalAppData%\Microsoft\WindowsApps\wt.exe

Upvotes: 0

zadjii
zadjii

Reputation: 684

You'll want to prepend wt.exe to that command, not replace cmd.exe. So the full commandline should look like:

wt cmd.exe /k echo hello world

That tells wt.exe to run the commandline cmd.exe /k echo hello world.

Upvotes: 7

Related Questions