Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การแก้ไขปัญหา >> ข้อผิดพลาด Windows

คืนคำสั่ง "Open command window here" ใน Context Menu Windows 10

หลังอัปเดต Creators Update ตัวเลือก "Open command window here" หายไป เปลี่ยนเป็น "Open PowerShell window here" แทน สามารถเพิ่มคำสั่ง Command Prompt กลับมาได้ 2 วิธี

วิธีที่ 1: ใช้ไฟล์ Registry (.reg) - เร็วที่สุด

  1. เปิด Notepad คัดลอกโค้ดด้านล่างไปวาง:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\shell\cmdprompt]
    @="@shell32.dll,-8506"
    "Extended"=""
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\Directory\shell\cmdprompt\command]
    @="cmd.exe /s /k pushd \"%V\""
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\cmdprompt]
    @="@shell32.dll,-8506"
    "Extended"=""
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\cmdprompt\command]
    @="cmd.exe /s /k pushd \"%V\""
    
    [HKEY_CLASSES_ROOT\Drive\shell\cmdprompt]
    @="@shell32.dll,-8506"
    "Extended"=""
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\Drive\shell\cmdprompt\command]
    @="cmd.exe /s /k pushd \"%V\""
  2. Save as: ประเภท All Files ชื่อ cmdfix.reg
  3. Double-click ไฟล์ > Yes > ตัวเลือก "Open command window here" จะกลับมา

เพื่อลบออก: สร้างไฟล์ Defaultcmd.reg เนื้อหา:

Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\shell\cmd2]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\cmd2]
[-HKEY_CLASSES_ROOT\Drive\shell\cmd2]
[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\cmd2]

วิธีที่ 2: แก้ Registry ด้วยตนเอง (คงคำสั่งเดิม "Open command window here")

  1. Win + R > regedit
  2. ไปที่: HKEY_CLASSES_ROOT\Directory\shell\cmd
  3. คลิกขวาโฟลเดอร์ cmd > Permissions > Advanced > Change Owner > ใส่ Username ของคุณ > Check Names > OK
  4. ติ๊ก Replace owner on subcontainers and objects > Apply/OK
  5. กลับ Permissions > เลือก Administrators > ให้ Full Control > Apply/OK
  6. ในโฟลเดอร์ cmd คลิกขวา DWORD HideBasedOnVelocityId > Rename เป็น ShowBasedOnVelocityId
  7. ปิด Regedit ตัวเลือกจะปรากฏทันที

วิธีลบ "Open PowerShell window here" ออกจาก Context Menu

  1. ไปที่: HKEY_CLASSES_ROOT\Directory\shell\PowerShell
  2. ทำขั้นตอน Permissions เหมือนข้างต้น (Take Ownership, Full Control)
  3. ในโฟลเดอร์ PowerShell คลิกขวา DWORD ShowBasedOnVelocityId > Rename เป็น HideBasedOnVelocityId
  4. ปิด Regedit

หมายเหตุ: ให้สร้าง Restore Point ก่อนแก้ Registry เสมอครับ