Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows

เพิ่ม Open Windows Terminal ใน Command Prompt, PowerShell profile context menu items

Windows Terminal เปิด Command Prompt, Windows PowerShell หลายแท็บในหน้าต่างเดียว และเปิดจาก Context Menu คลิกขวา แต่ตัวเลือกเริ่มต้นเปิด default startup profile คุณสามารถเพิ่ม context menu แบบขยาย (cascading) เพื่อเปิดโปรไฟล์ตามต้องการได้

เพิ่ม Open Windows Terminal ใน Default, Command Prompt, PowerShell profile context menu items

เพิ่ม Open Windows Terminal ใน Command Prompt, PowerShell profile context menu items

สมมติ default startup profile เป็น Command Prompt แต่ต้องการเปิด Windows PowerShell ตอนนั้นใช้ context menu เปิด Windows PowerShell ใน Windows Terminal โดยไม่ต้องใช้สิทธิ์ผู้ดูแล ทำได้ผ่าน Registry Editor แนะนำสร้าง System Restore point ก่อน

เพิ่ม Windows Terminal แบบขยายใน context menu เพื่อเปิดโปรไฟล์ใดก็ได้

ขั้นตอนเพิ่ม Windows Terminal แบบขยายใน context menu:

  1. เปิด Notepad
  2. วางข้อความต่อไปนี้
  3. คลิก File > Save As
  4. เลือกตำแหน่ง ตั้งชื่อ副檔名 .reg เลือก All Files จาก Save as type
  5. คลิก Save
  6. ดับเบิลคลิกไฟล์ .reg ยืนยันการเพิ่ม
  7. คลิกขวาบน Desktop เพื่อหาตัวเลือก

รายละเอียดเพิ่มเติม:

เปิด Notepad วางข้อความ:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere]
"MUIVerb"="Open in Windows Terminal"
"Extended"=-
"SubCommands"=""
[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHere\shell\001flyout]
"MUIVerb"="Open in Windows Terminal Default Profile"
[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHere\shell\001flyout\command]
@="cmd.exe /c start wt.exe -d \"%1\""
[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHere\shell\002flyout]
"MUIVerb"="Open in Windows Terminal Command Prompt"
"Icon"="imageres.dll,-5323"
[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHere\shell\002flyout\command]
@="cmd.exe /c start wt.exe -p \"Command Prompt\" -d \"%1\""
[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHere\shell\003flyout]
"MUIVerb"="Open in Windows Terminal PowerShell"
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHere\shell\003flyout\command]
@="cmd.exe /c start wt.exe -p \"Windows PowerShell\" -d \"%1\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHere]
"MUIVerb"="Open in Windows Terminal"
"Extended"=-
"SubCommands"=""
[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHere\shell\001flyout]
"MUIVerb"="Open in Windows Terminal Default Profile"
[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHere\shell\001flyout\command]
@="cmd.exe /c start wt.exe -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHere\shell\002flyout]
"MUIVerb"="Open in Windows Terminal Command Prompt"
"Icon"="imageres.dll,-5323"
[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHere\shell\002flyout\command]
@="cmd.exe /c start wt.exe -p \"Command Prompt\" -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHere\shell\003flyout]
"MUIVerb"="Open in Windows Terminal PowerShell"
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHere\shell\003flyout\command]
@="cmd.exe /c start wt.exe -p \"Windows PowerShell\" -d \"%V\""

คลิก File > Save As เลือกตำแหน่ง

เพิ่ม Open Windows Terminal ใน Command Prompt, PowerShell profile context menu items

ตั้งชื่อ .reg (เช่น TermExpMenu.reg) เลือก All Files จาก Save as type คลิก Save

ดับเบิลคลิก .reg ที่สร้าง คลิก Yes

หากต้องการ ดาวน์โหลดไฟล์ Registry พร้อมใช้ของเราได้

ตอนนี้คลิกขวาบน Desktop จะเจอตัวเลือก Windows Terminal แบบขยายใน Context Menu เพื่อเปิดโปรไฟล์ใดก็ได้โดยตรง

หากไม่ต้องการ context menu นี้แล้ว ต้องการลบ ทำตามขั้นตอน:

เปิด Registry Editor ไปที่พาธ:

HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere
HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHere

คลิกขวา OpenWTHere key เลือก Delete

เพิ่ม Open Windows Terminal ใน Command Prompt, PowerShell profile context menu items

คลิก OK ยืนยันการลบ

อาจต้องรีสตาร์ทหรือ sign out/sign in ใหม่

ต่อไปจะดูวิธีเพิ่ม Open Windows Terminal as an administrator ใน Context Menu

เสร็จแล้ว! หวังว่าคู่มือนี้ช่วยเพิ่มตัวเลือก Windows Terminal แบบขยายใน Context Menu เพื่อเปิดโปรไฟล์ที่ต้องการ

อ่านเพิ่มเติม:

  • Remove Open in Windows Terminal from Context Menu
  • How to change the Default Shell in Windows Terminal.

เพิ่ม Open Windows Terminal ใน Command Prompt, PowerShell profile context menu items