วิธีเพิ่ม Edit หรือ Run with ในเมนูคลิกขวาของไฟล์ PS1

วิธีเพิ่ม Edit หรือ Run with ในเมนูคลิกขวาของไฟล์ PS1

ไฟล์ PS1 เป็นสคริปต์หรือcmdletซึ่งใช้ โดย Windows PowerShell

คู่มือนี้จะแสดงวิธีเพิ่มหรือลบเมนูแก้ไขหรือเรียกใช้ด้วยแบบกำหนดเองในเมนูบริบทสำหรับไฟล์ PowerShell .ps1 สำหรับผู้ใช้ทั้งหมดในWindows 10

เมนูแก้ไขหรือเรียกใช้ด้วยบริบทประกอบด้วยรายการต่อไปนี้สำหรับไฟล์ PS1:

  • ทำงานด้วย PowerShell
  • รันด้วย PowerShell ในฐานะผู้ดูแลระบบ
  • รันด้วย PowerShell 7
  • รันด้วย PowerShell 7 ในฐานะผู้ดูแลระบบ
  • แก้ไขด้วย PowerShell ISE
  • แก้ไขด้วย PowerShell ISE ในฐานะผู้ดูแลระบบ
  • แก้ไขด้วย PowerShell ISE (x86)
  • แก้ไขด้วย PowerShell ISE (x86) ในฐานะผู้ดูแลระบบ
  • แก้ไขด้วย Notepad
  • แก้ไขด้วย Notepad ในฐานะผู้ดูแลระบบ

วิธีเพิ่ม Edit หรือ Run with ในเมนูคลิกขวาของไฟล์ PS1

เพิ่ม "แก้ไขหรือเรียกใช้ด้วย" ลงในเมนูคลิกขวาของไฟล์ PS1 ใน Windows 10

วิธีเพิ่ม "แก้ไขหรือเรียกใช้ด้วย" ในเมนูคลิกขวาของไฟล์ PS1 ใน Windows 10

มีวิธีดังนี้:

1. ทำตามขั้นตอนที่ 2 (เพิ่ม - คลิกขวา) ขั้นตอนที่ 3 (เพิ่ม - Shift + คลิกขวา) หรือขั้นตอนที่ 4 (ลบ) ด้านล่าง ขึ้นอยู่กับสิ่งที่คุณต้องการทำ

2. หากต้องการเพิ่ม เมนูบริบทของไฟล์ PS1 "แก้ไขหรือรันด้วย" (เพียงคลิกขวาเพื่อแสดง) ให้ดาวน์โหลดไฟล์ Add_Edit_or_Run_with_to_PS1_context_menu.reg

เนื้อหาของไฟล์ REG) - รหัส:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\.ps1]

[HKEY_CLASSES_ROOT\.ps1]
@="Microsoft.PowerShellScript.1"

[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]
"EditFlags"=dword:00020000
"FriendlyTypeName"=hex(2):40,00,22,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,\
  00,72,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,\
  33,00,32,00,5c,00,77,00,69,00,6e,00,64,00,6f,00,77,00,73,00,70,00,6f,00,77,\
  00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,5c,00,76,00,31,00,2e,00,30,00,\
  5c,00,70,00,6f,00,77,00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,2e,00,65,\
  00,78,00,65,00,22,00,2c,00,2d,00,31,00,30,00,33,00,00,00

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\",1"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell]
@="Open"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]
"MUIVerb"="Edit or Run with"
"Extended"=-
"SubCommands"=""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout]
"MUIVerb"="Run with PowerShell"
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout]
"MUIVerb"="Run with PowerShell as administrator"
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"\"& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""



[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout]
"MUIVerb"="Run with PowerShell 7"
"Icon"="pwsh.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout]
"MUIVerb"="Run with PowerShell 7 as administrator"
"HasLUAShield"=""
"Icon"="pwsh.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"\"& {Start-Process pwsh.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout]
"MUIVerb"="Edit with PowerShell ISE"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout]
"MUIVerb"="Edit with PowerShell ISE as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start PowerShell_ISE.exe \"\"%1\"\"'  -Verb RunAs\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout]
"MUIVerb"="Edit with PowerShell ISE (x86)"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout\Command]
@="\"C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout]
"MUIVerb"="Edit with PowerShell ISE (x86) as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe \"\"%1\"\"'  -Verb RunAs\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout]
"MUIVerb"="Edit with Notepad"
"Icon"="notepad.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout]
"MUIVerb"="Edit with Notepad as administrator"
"HasLUAShield"=""
"Icon"="notepad.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\Windows\\System32\\notepad.exe \"\"%1\"\"'  -Verb RunAs\""

3. หากต้องการเพิ่มเมนูบริบทของไฟล์ PS1 "แก้ไขหรือเรียกใช้ด้วย" (กด Shift + คลิกขวาเพื่อแสดง) ให้ดาวน์โหลดไฟล์ Add_Shift + Edit_or_Run_with_to_PS1_context_menu.reg

เนื้อหาของ REG - ไฟล์โค้ด:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\.ps1]

[HKEY_CLASSES_ROOT\.ps1]
@="Microsoft.PowerShellScript.1"

[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1]
"EditFlags"=dword:00020000
"FriendlyTypeName"=hex(2):40,00,22,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,\
  00,72,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,\
  33,00,32,00,5c,00,77,00,69,00,6e,00,64,00,6f,00,77,00,73,00,70,00,6f,00,77,\
  00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,5c,00,76,00,31,00,2e,00,30,00,\
  5c,00,70,00,6f,00,77,00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,2e,00,65,\
  00,78,00,65,00,22,00,2c,00,2d,00,31,00,30,00,33,00,00,00

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\",1"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell]
@="Open"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]
"MUIVerb"="Edit or Run with"
"Extended"=""
"SubCommands"=""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout]
"MUIVerb"="Run with PowerShell"
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\001flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout]
"MUIVerb"="Run with PowerShell as administrator"
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\002flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"\"& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""



[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout]
"MUIVerb"="Run with PowerShell 7"
"Icon"="pwsh.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\003flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout]
"MUIVerb"="Run with PowerShell 7 as administrator"
"HasLUAShield"=""
"Icon"="pwsh.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\004flyout\Command]
@="\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" \"-Command\" \"\"& {Start-Process pwsh.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File \\\"%1\\\"' -Verb RunAs}\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout]
"MUIVerb"="Edit with PowerShell ISE"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\005flyout\Command]
@="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout]
"MUIVerb"="Edit with PowerShell ISE as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\006flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start PowerShell_ISE.exe \"\"%1\"\"'  -Verb RunAs\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout]
"MUIVerb"="Edit with PowerShell ISE (x86)"
"Icon"="powershell_ise.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\007flyout\Command]
@="\"C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout]
"MUIVerb"="Edit with PowerShell ISE (x86) as administrator"
"HasLUAShield"=""
"Icon"="powershell_ise.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\008flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\WINDOWS\\syswow64\\WindowsPowerShell\\v1.0\\powershell_ise.exe \"\"%1\"\"'  -Verb RunAs\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout]
"MUIVerb"="Edit with Notepad"
"Icon"="notepad.exe"
"CommandFlags"=dword:00000020

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\009flyout\Command]
@="\"C:\\Windows\\System32\\notepad.exe\" \"%1\""


[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout]
"MUIVerb"="Edit with Notepad as administrator"
"HasLUAShield"=""
"Icon"="notepad.exe"

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with\shell\010flyout\Command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/c,start C:\\Windows\\System32\\notepad.exe \"\"%1\"\"'  -Verb RunAs\""

4. หากต้องการลบเมนูบริบทของไฟล์ PS1 "แก้ไขหรือรันด้วย" ให้ดาวน์โหลดไฟล์ Remove_Edit_or_Run_with_from_PS1_context_menu.reg

เนื้อหาของ REG - ไฟล์โค้ด:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit-Run-with]

5. บันทึกไฟล์ .reg ไว้ที่เดสก์ท็อป

6. ดับเบิลคลิกไฟล์ .regที่ดาวน์โหลดมา เพื่อรวมเข้าด้วยกัน

7. เมื่อได้รับแจ้ง คลิกRun > Yes (UAC) > Yes > OKเพื่ออนุมัติการผสาน

8. ตอนนี้คุณสามารถลบไฟล์ .reg ที่ดาวน์โหลดมาได้หากต้องการ

หวังว่าคุณจะประสบความสำเร็จ


วิธีย่อขนาดหน้าจอใน Windows 10

วิธีย่อขนาดหน้าจอใน Windows 10

บทความนี้จะแสดงวิธีย่อขนาดหน้าจอใน Windows 10 เพื่อให้คุณใช้งานได้อย่างมีประสิทธิภาพ

วิธีปิด (หรือเปิด) Xbox Game Bar บน Windows 10

วิธีปิด (หรือเปิด) Xbox Game Bar บน Windows 10

Xbox Game Bar เป็นเครื่องมือสนับสนุนที่ยอดเยี่ยมที่ Microsoft ติดตั้งบน Windows 10 ซึ่งผู้ใช้สามารถเรียนรู้วิธีเปิดหรือปิดได้อย่างง่ายดาย

5 วิธีในการจดบันทึกบน Windows 11 โดยไม่ต้องดาวน์โหลดซอฟต์แวร์

5 วิธีในการจดบันทึกบน Windows 11 โดยไม่ต้องดาวน์โหลดซอฟต์แวร์

หากความจำของคุณไม่ค่อยดี คุณสามารถใช้เครื่องมือเหล่านี้เพื่อเตือนตัวเองถึงสิ่งสำคัญขณะทำงานได้

วิธีนำแอพพลิเคชั่นไปไว้บนหน้าจอคอมพิวเตอร์ Windows 11

วิธีนำแอพพลิเคชั่นไปไว้บนหน้าจอคอมพิวเตอร์ Windows 11

หากคุณคุ้นเคยกับ Windows 10 หรือเวอร์ชันก่อนหน้า คุณอาจประสบปัญหาในการนำแอปพลิเคชันไปยังหน้าจอคอมพิวเตอร์ของคุณในอินเทอร์เฟซ Windows 11 ใหม่ มาทำความรู้จักกับวิธีการง่ายๆ เพื่อเพิ่มแอพพลิเคชั่นลงในเดสก์ท็อปของคุณ

วิธีถอนการติดตั้งไดรเวอร์บน Windows อย่างสมบูรณ์

วิธีถอนการติดตั้งไดรเวอร์บน Windows อย่างสมบูรณ์

เพื่อหลีกเลี่ยงปัญหาและข้อผิดพลาดหน้าจอสีน้ำเงิน คุณต้องลบไดรเวอร์ที่ผิดพลาดซึ่งเป็นสาเหตุของปัญหาออก บทความนี้จะแนะนำวิธีถอนการติดตั้งไดรเวอร์บน Windows โดยสมบูรณ์

วิธีเปิดใช้งานแป้นพิมพ์เสมือน/แป้นพิมพ์สัมผัสบน Windows 11

วิธีเปิดใช้งานแป้นพิมพ์เสมือน/แป้นพิมพ์สัมผัสบน Windows 11

เรียนรู้วิธีเปิดใช้งานแป้นพิมพ์เสมือนบน Windows 11 เพื่อเพิ่มความสะดวกในการใช้งาน ผสานเทคโนโลยีใหม่เพื่อประสบการณ์ที่ดียิ่งขึ้น

วิธีใช้ AdLock เพื่อบล็อกโฆษณาบนคอมพิวเตอร์ของคุณ

วิธีใช้ AdLock เพื่อบล็อกโฆษณาบนคอมพิวเตอร์ของคุณ

เรียนรู้การติดตั้งและใช้ AdLock เพื่อบล็อกโฆษณาบนคอมพิวเตอร์ของคุณอย่างมีประสิทธิภาพและง่ายดาย

หนอนคืออะไร? เหตุใดจึงเป็นอันตรายต่อคอมพิวเตอร์?

หนอนคืออะไร? เหตุใดจึงเป็นอันตรายต่อคอมพิวเตอร์?

เวิร์มคอมพิวเตอร์คือโปรแกรมมัลแวร์ประเภทหนึ่งที่มีหน้าที่หลักคือการแพร่ไวรัสไปยังคอมพิวเตอร์เครื่องอื่นในขณะที่ยังคงทำงานอยู่บนระบบที่ติดไวรัส

วิธีดาวน์โหลด อัปเดต และแก้ไขปัญหาไดรเวอร์ USB บน Windows 10

วิธีดาวน์โหลด อัปเดต และแก้ไขปัญหาไดรเวอร์ USB บน Windows 10

เรียนรู้วิธีดาวน์โหลดและอัปเดตไดรเวอร์ USB บนอุปกรณ์ Windows 10 เพื่อให้ทำงานได้อย่างราบรื่นและมีประสิทธิภาพ

5 วิธีในการปรับแต่ง Xbox Game Bar บน Windows PC

5 วิธีในการปรับแต่ง Xbox Game Bar บน Windows PC

หากคุณต้องการเรียนรู้เพิ่มเติมเกี่ยวกับ Xbox Game Bar และวิธีปรับแต่งให้เหมาะกับประสบการณ์การเล่นเกมที่สมบูรณ์แบบของคุณ บทความนี้มีข้อมูลทั้งหมด