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

แก้ไข "Process Exited with Code 1" บน Command Prompt

ผู้ใช้ Windows บางรายเจอข้อความ "Process exited with code 1" ทันทีที่เปิด Command Prompt ไม่มี Prompt ให้ใช้งาน เกิดมักเมื่อติดตั้ง Anaconda (Toolkit Data Science ใช้ Python/R) ซึ่งมาพร้อม Anaconda Prompt และเครื่องมืออื่นๆ

แก้ไข  Process Exited with Code 1  บน Command Prompt

Anaconda สร้าง Registry Key AutoRun ใต้ Command Processor ทำให้ CMD รันคำสั่งอัตโนมัติตอนเปิด และล้มเหลว วิธีแก้: ลบ Key AutoRun นี้

วิธี 1: ใช้ PowerShell (แนะนำ - ง่ายกว่า)

  1. ค้นหา PowerShell → คลิกขวา → Run as administrator
    แก้ไข  Process Exited with Code 1  บน Command Prompt
  2. วางคำสั่งนี้ → Enter:
    C:\Windows\System32\reg.exe DELETE "HKCU\Software\Microsoft\Command Processor" /v AutoRun /f
    แก้ไข  Process Exited with Code 1  บน Command Prompt
  3. รีสตาร์ทคอมพิวเตอร์
  4. เปิด CMD ทดสอบว่าปัญหาหายหรือไม่

วิธี 2: ลบ AutoRun Key ด้วยมือ (Registry Editor)

แนะนำ: สำรอง Registry ก่อน

  1. Win + R → regedit → Enter
    แก้ไข  Process Exited with Code 1  บน Command Prompt
  2. ใน Address bar วาง Path:
    Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor
    แก้ไข  Process Exited with Code 1  บน Command Prompt
  3. ด้านขวา คลิกขวา AutoRun → Delete
    แก้ไข  Process Exited with Code 1  บน Command Prompt
  4. รีสตาร์ท → เปิด CMD ทดสอบ

วิธี 3: สร้าง User Account ใหม่

หาวิธีข้างบนไม่ได้ ให้สร้างบัญชีใหม่ (ผู้ใช้รายอื่นแก้ได้ด้วยวิธีนี้) แล้วย้ายข้อมูลไปบัญชีใหม่:

  1. Win + I → Settings
    แก้ไข  Process Exited with Code 1  บน Command Prompt
  2. ไป Accounts
  3. คลิก Family & other users
    แก้ไข  Process Exited with Code 1  บน Command Prompt
  4. คลิก Add account หน้า Add other user
    แก้ไข  Process Exited with Code 1  บน Command Prompt
  5. ทำตามหน้าจอสร้างบัญชีใหม่