1、首先下载一个图标
下载地址:https://raw.githubusercontent.com/microsoft/terminal/master/res/terminal.ico
把图标放到某个文件夹内,比如:"%USERPROFILE%\AppData\Local\terminal" 内。
2、新建 xx.bat文件,并把下列代码拷贝进去保存
@echo off
reg.exe add "HKEY_CLASSES_ROOT\Directory\Background\shell\wt" /f /ve /d "Windows Terminal here"
reg.exe add "HKEY_CLASSES_ROOT\Directory\Background\shell\wt" /f /v "Icon" /t REG_EXPAND_SZ /d "%USERPROFILE%\AppData\Local\terminal\terminal.ico"
reg.exe add "HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command" /f /ve /t REG_EXPAND_SZ /d "%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe
pause
3、以管理员运行脚本
4、修改windows terminal的设置
修改startingDirectory
属性为null
;
5、效果