Skip to content

Instantly share code, notes, and snippets.

View ImmortalTerror's full-sized avatar
💭
In pain

ImmortalTerror

💭
In pain
View GitHub Profile
@ImmortalTerror
ImmortalTerror / windows terminal with batch.md
Created December 22, 2021 15:14
How to make batchfiles open with windows terminal

First, you want to open up regedit and navigate to Computer\HKEY_CLASSES_ROOT\batfile\shell\open\command. Right click on the value named "Default" and click modify, change the value data to wt.exe -w 0 new-tab -d . "%1" %*. You can stop here if you wish as now when you run a .bat it will open in Windows Terminal. But if you want to be able to right click on a file and have the option to run in cmd, make a new key in Computer\HKEY_CLASSES_ROOT\batfile\shell called wtopen, change the "Default" value data in that to "Open in cmd". Then, make a subkey in Computer\HKEY_CLASSES_ROOT\batfile\shell\wtopen called "command" and change the "Default" value data to "%1" %*. Now if you right click on a .bat you should have the option to "Run in cmd".