How to add 'Edit or Run with' to the right-click menu of PS1 files
The Edit or Run with context menu includes the following items for PS1 files:
- Run with PowerShell
- Run with PowerShell as administrator
- Run with PowerShell 7
- Run with PowerShell 7 as administrator
- Edit with PowerShell ISE
- Edit with PowerShell ISE as administrator
- Edit with PowerShell ISE (x86)
- Edit with PowerShell ISE (x86) as administrator
- Edit with Notepad
- Edit with Notepad as administrator
How to add "Edit or Run with" to the right-click menu of PS1 files in Windows 10
Here's how to do it:
Step 1. Do step 2 (add - right click), step 3 (add - Shift + right click) or step 4 (delete) below depending on what you want to do.
Step 2. To add the "Edit or Run with" PS1 file context menu (just right-click to show it), download the Add_Edit_or_Run_with_to_PS1_context_menu.reg file.
Contents of REG file) - Code:
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT.ps1] [HKEY_CLASSES_ROOT.ps1] @="Microsoft.PowerShellScript.1" [-HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1] [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1] "EditFlags"=dword:00020000 " =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_ROOTMicrosoft.PowerShellScript.1DefaultIcon] @=""C:WindowsSystem32WindowsPowerShellv1.0 powershell_ise.exe",1"[HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1Shell] @="Open" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellOpenCommand] @=""C:WindowsSystem32notepad.exe" "%1"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-with] "MUIVerb"="Edit or Run with" "Extended"=- "SubCommands"="" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell01flyout] "MUIVerb"="Run with PowerShell" "Icon"="powershell.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell01flyoutCommand] @=""C:WindowsSystem32WindowsPowerShellv1.0powershell.exe" "-Command" "if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell02flyout] "MUIVerb"="Run with PowerShell as administrator" "HasLUashield"="" "Icon"="powershell.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run -withshell02flyoutCommand] @=""C:WindowsSystem32WindowsPowerShellv1.0powershell.exe" "-Command" ""& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File "%1 "' -Verb RunAs}"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell03flyout] "MUIVerb"="Run with PowerShell 7" "Icon"="pwsh.exe" "CommandFlags"=dword:00000020 [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript .1ShellEdit-Run-withshell03flyoutCommand] @=""C:Program FilesPowerShell7pwsh.exe" "-Command" "if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell04flyout] "MUIVerb"="Run with PowerShell 7 as administrator" "HasLUAShield"="" "Icon"="pwsh.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript. 1ShellEdit-Run-withshell04flyoutCommand] @=""C:Program FilesPowerShell7pwsh.exe" "-Command" ""& {Start-Process pwsh.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File "%1 "' -Verb RunAs}"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell05flyout] "MUIVerb"="Edit with PowerShell ISE" "Icon"="powershell_ise.exe" "CommandFlags"=dword:00000020 [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell05flyoutCommand] @=""C: WindowsSystem32WindowsPowerShellv1.0powershell_ise.exe" "%1"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell06flyout] "MUIVerb"="Edit with PowerShell ISE as administrator" "HasLUAShield"="" "Icon "="powershell_ise.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell06flyoutCommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd -ArgumentList '/s,/c,start PowerShell_ISE.exe ""%1" "'-Verb RunAs"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell07flyout] "MUIVerb"="Edit with PowerShell ISE (x86)" "Icon"="powershell_ise.exe" "CommandFlags"=dword:00000020 [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript 1ShellEdit-Run-withshell07flyoutCommand] @=""C:WINDOWSsyswow64WindowsPowerShellv1.0powershell_ise.exe" "%1"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell08flyout] "MUIVerb"="Edit with PowerShell ISE (x86) as administrator" "HasLUAShield"="" "Icon"="powershell_ise.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell08flyoutCommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd -ArgumentList '/s,/c,start C:WINDOWSsyswow64WindowsPowerShellv1.0powershell_ise.exe ""%1""' -Verb RunAs"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run -withshell09flyout] "MUIVerb"="Edit with Notepad" "Icon"="notepad.exe" "CommandFlags"=dword:00000020 [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell09flyoutCommand] @=""C:WindowsSystem32 notepad.exe" "%1"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell10flyout] "MUIVerb"="Edit with Notepad as administrator" "HasLUAShield"="" "Icon"="notepad.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript .1ShellEdit-Run-withshell10flyoutCommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd -ArgumentList '/s,/c,start C:WindowsSystem32notepad.exe ""%1""' -Verb RunAs""
Step 3. To add the "Edit or Run with" PS1 file context menu (Shift + right-click to display), download the Add_Shift + Edit_or_Run_with_to_PS1_context_menu.reg file.
Contents of file REG - Code:
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT.ps1] [HKEY_CLASSES_ROOT.ps1] @="Microsoft.PowerShellScript.1" [-HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1] [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1] "EditFlags"=dword:00020000 " =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_ROOTMicrosoft.PowerShellScript.1DefaultIcon] @=""C:WindowsSystem32WindowsPowerShellv1.0 powershell_ise.exe",1"[HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1Shell] @="Open" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellOpenCommand] @=""C:WindowsSystem32notepad.exe" "%1"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-with] "MUIVerb"="Edit or Run with" "Extended"="" "SubCommands"="" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell01flyout] "MUIVerb"="Run with PowerShell" "Icon"="powershell.exe " [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell01flyoutCommand] @=""C:WindowsSystem32WindowsPowerShellv1.0powershell.exe" "-Command" "if((Get-ExecutionPolicy ) -ne 'AllSigned'" ) { Set-ExecutionPolicy -Scope Process Bypass };& '%1'"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell02flyout] "MUIVerb"="Run with PowerShell as administrator" "HasLUAShield"="" "Icon"="powershell.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit -Run-withshell02flyoutCommand] @=""C:WindowsSystem32WindowsPowerShellv1.0powershell.exe" "-Command" ""& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File " %1"' -Verb RunAs}"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell03flyout] "MUIVerb"="Run with PowerShell 7" "Icon"="pwsh.exe" "CommandFlags"=dword:00000020 [HKEY_CLASSES_ROOTMicrosoft .PowerShellScript.1ShellEdit-Run-withshell03flyoutCommand] @=""C:Program FilesPowerShell7pwsh.exe" "-Command" "if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell04flyout] "MUIVerb"="Run with PowerShell 7 as administrator" "HasLUAShield"="" "Icon"="pwsh.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript. 1ShellEdit-Run-withshell04flyoutCommand] @=""C:Program FilesPowerShell7pwsh.exe" "-Command" ""& {Start-Process pwsh.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File "%1 "' -Verb RunAs}"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell05flyout] "MUIVerb"="Edit with PowerShell ISE" "Icon"="powershell_ise.exe" "CommandFlags"=dword:00000020 [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell05flyoutCommand] @=""C: WindowsSystem32WindowsPowerShellv1.0powershell_ise.exe" "%1"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell06flyout] "MUIVerb"="Edit with PowerShell ISE as administrator" "HasLUAShield"="" "Icon "="powershell_ise.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell06flyoutCommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd -ArgumentList '/s,/c,start PowerShell_ISE.exe ""%1" "'-Verb RunAs"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell07flyout] "MUIVerb"="Edit with PowerShell ISE (x86)" "Icon"="powershell_ise.exe" "CommandFlags"=dword:00000020 [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript 1ShellEdit-Run-withshell07flyoutCommand] @=""C:WINDOWSsyswow64WindowsPowerShellv1.0powershell_ise.exe" "%1"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell08flyout] "MUIVerb"="Edit with PowerShell ISE (x86) as administrator" "HasLUAShield"="" "Icon"="powershell_ise.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell08flyoutCommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd -ArgumentList '/s,/c,start C:WINDOWSsyswow64WindowsPowerShellv1.0powershell_ise.exe ""%1""' -Verb RunAs"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run -withshell09flyout] "MUIVerb"="Edit with Notepad" "Icon"="notepad.exe" "CommandFlags"=dword:00000020 [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell09flyoutCommand] @=""C:WindowsSystem32 notepad.exe" "%1"" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-withshell10flyout] "MUIVerb"="Edit with Notepad as administrator" "HasLUAShield"="" "Icon"="notepad.exe" [HKEY_CLASSES_ROOTMicrosoft.PowerShellScript .1ShellEdit-Run-withshell10flyoutCommand] @="PowerShell -windowstyle hidden -Command "Start-Process cmd -ArgumentList '/s,/c,start C:WindowsSystem32notepad.exe ""%1""' -Verb RunAs""
Step 4. To remove the "Edit or Run with" PS1 file context menu, download the Remove_Edit_or_Run_with_from_PS1_context_menu.reg file.
Contents of file REG - Code:
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOTMicrosoft.PowerShellScript.1ShellEdit-Run-with]
Step 5. Save the .reg file to the desktop.
Step 6. Double-click the downloaded .reg file to merge.
Step 7. When prompted, click Run > Yes (UAC) > Yes > OK to approve the merge.
Step 8. Now you can delete the downloaded .reg file if you want.
Hope you are succesful.
You should read it
- Microsoft is committed to improving the context menu experience on Windows 11
- How to delete options in the Windows context menu
- This small application helps bring the context menu interface of Windows 10 to Windows 11
- How to fix slow context menu in Windows 10's File Explorer
- 2 simple ways to remove SkyDrive Pro option in Windows 10 Right-click Menu
- How to Clean the Windows Context Menu via Registry
- How to add / remove 'Open in Windows Terminal' context menu in Windows 10
- How to bring Windows 10's right-click menu to Windows 11
May be interested
- Microsoft fixes loud noises on Windows 10microsoft fixed an issue that caused some apps to make loud noises or crackles when used in windows 10 2004, windows 10 20h2, and windows 10 21h1.
- How to check PowerShell version in Windows 10powershell is one of the extremely useful command tools for advanced windows 10 users.
- 6 websites to download software, safe applications for Windows 10windows has tons of useful software and of course, comes with many different websites so you can find, download and install the software you want.
- 5 best equalizer software for Windows 10 to improve PC soundif you are an audio enthusiast, a heavy gamer, or simply enjoy customizing the sound on windows 10, you might be looking for an equalizer app.
- How to Install Windows Terminal on Windows 10windows terminal is an open source application that allows you to open multiple console tabs in the same window.
- Steps to minimize the screen in Windows 10this article will show you how to minimize the screen in windows 10.