Search code examples
windows-terminal

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."


Solution

  • 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.