In this post I would like to show you how to add an
Open Terminal here entry to Right-Click menu in Windows.
Also, you can get a script to run all the commands for you here: https://github.com/zeroby0/open-terminal-here
Open a new Terminal window and type these commands to download a high resolution icon to show in the menu.
$ICON_URL = "https://raw.githubusercontent.com/zeroby0/open-terminal-here/master/wt.ico" $ICON_PATH = "$env:LOCALAPPDATA\wt_terminal" $WT_PATH = "$env:LOCALAPPDATA\Microsoft\WindowsApps\wt.exe" # Download icon New-Item -ItemType "directory" -Path "$ICON_PATH" Invoke-WebRequest "$ICON_URL" -OutFile "$ICON_PATH\wt.ico"
Now let's add some registry entries. You can now click on a folder and open terminal there.
# Add entry on folders $REG_PATH = "HKCU:\Software\Classes\Directory\shell\wt_terminal" New-Item -Path $REG_PATH -Value "Open in Terminal" -Force New-Item -Path "$REG_PATH\command" -Value "$WT_PATH -d `"%V%`"" -Force New-ItemProperty -Path $REG_PATH -Name "Icon" -Value "$ICON_PATH\wt.ico"
To open Terminal inside a folder by clicking on the Explorer background, run the following commands.
# Add entry inside folders $REG_PATH = "HKCU:\Software\Classes\Directory\Background\shell\wt_terminal" New-Item -Path $REG_PATH -Value "Open Terminal here" -Force New-Item -Path "$REG_PATH\command" -Value "$WT_PATH -d `"%V%`"" -Force New-ItemProperty -Path $REG_PATH -Name "Icon" -Value "$ICON_PATH\wt.ico"
Aand that's it! It should work on all the recent builds on Windows 10. But if it doesn't work for you, let me know in the comments below and I'll try to help. 🙂