Comment ajouter Modifier ou Exécuter avec au menu contextuel du fichier PS1

Comment ajouter Modifier ou Exécuter avec au menu contextuel du fichier PS1

Un fichier PS1 est un script ou une applet de commande utilisé par Windows PowerShell .

Ce guide vous montrera comment ajouter ou supprimer un menu Modifier ou Exécuter avec personnalisé dans le menu contextuel des fichiers PowerShell .ps1 pour tous les utilisateurs de Windows 10 .

Le menu contextuel Modifier ou Exécuter avec comprend les éléments suivants pour les fichiers PS1 :

  • Exécuter avec PowerShell
  • Exécuter avec PowerShell en tant qu'administrateur
  • Exécuter avec PowerShell 7
  • Exécuter avec PowerShell 7 en tant qu'administrateur
  • Modifier avec PowerShell ISE
  • Modifier avec PowerShell ISE en tant qu'administrateur
  • Modifier avec PowerShell ISE (x86)
  • Modifier avec PowerShell ISE (x86) en tant qu'administrateur
  • Modifier avec le Bloc-notes
  • Modifier avec le Bloc-notes en tant qu'administrateur

Comment ajouter Modifier ou Exécuter avec au menu contextuel du fichier PS1

Ajoutez « Modifier ou exécuter avec » au menu contextuel du fichier PS1 dans Windows 10

Comment ajouter « Modifier ou exécuter avec » au menu contextuel du fichier PS1 dans Windows 10

Voici comment:

1. Effectuez l'étape 2 (ajouter - clic droit), l'étape 3 (ajouter - Maj + clic droit) ou l'étape 4 (supprimer) ci-dessous selon ce que vous souhaitez faire.

2. Pour ajouter le menu contextuel du fichier PS1 « Modifier ou exécuter avec » (cliquez simplement avec le bouton droit pour afficher), téléchargez le fichier Add_Edit_or_Run_with_to_PS1_context_menu.reg .

Contenu du fichier REG) - Code :

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. Pour ajouter le menu contextuel du fichier PS1 "Modifier ou exécuter avec" (appuyez sur Shift + clic droit pour afficher), téléchargez le fichier Add_Shift + Edit_or_Run_with_to_PS1_context_menu.reg .

Contenu du fichier REG - Code :

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. Pour supprimer le menu contextuel du fichier PS1 « Modifier ou exécuter avec », téléchargez le fichier Remove_Edit_or_Run_with_from_PS1_context_menu.reg .

Contenu du fichier REG - Code :

Windows Registry Editor Version 5.00

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

5. Enregistrez le fichier .reg sur le bureau.

6. Double-cliquez sur le fichier .reg téléchargé pour fusionner.

7. Lorsque vous y êtes invité, cliquez sur Exécuter > Oui (UAC) > Oui > OK pour approuver la fusion.

8. Vous pouvez maintenant supprimer le fichier .reg téléchargé si vous le souhaitez.

J'espère que vous réussirez.


Comment lancer des applications instantanément avec Wox sous Windows

Comment lancer des applications instantanément avec Wox sous Windows

Découvrez comment utiliser Wox pour lancer vos applications, exécuter des commandes et plus encore, instantanément.

Comment créer un cercle jaune autour du pointeur de la souris sous Windows

Comment créer un cercle jaune autour du pointeur de la souris sous Windows

Découvrez comment créer un cercle jaune autour du pointeur de la souris pour le mettre en surbrillance sur Windows 10. Suivez ces étapes faciles pour améliorer votre expérience utilisateur.

Pourquoi ladresse IP de Localhost est-elle 127.0.0.1 ?

Pourquoi ladresse IP de Localhost est-elle 127.0.0.1 ?

Découvrez pourquoi l

Comment ajouter des raccourcis de dossiers au menu Démarrer sous Windows 11

Comment ajouter des raccourcis de dossiers au menu Démarrer sous Windows 11

Sous Windows 11, configurez facilement des raccourcis pour accéder rapidement à des dossiers spéciaux dans votre menu Démarrer.

8 façons de corriger lerreur Il ny a aucun élément de démarrage à afficher dans le Gestionnaire des tâches sous Windows

8 façons de corriger lerreur Il ny a aucun élément de démarrage à afficher dans le Gestionnaire des tâches sous Windows

Découvrez comment résoudre l

Comment utiliser un disque dur externe avec un Chromebook

Comment utiliser un disque dur externe avec un Chromebook

Découvrez comment utiliser un disque dur externe avec un Chromebook pour transférer et stocker vos fichiers en toute sécurité. Suivez nos étapes pour un usage optimal.

Comment activer une adresse MAC aléatoire pour le réseau WiFi sous Windows 10

Comment activer une adresse MAC aléatoire pour le réseau WiFi sous Windows 10

Dans ce guide, vous apprendrez les étapes pour toujours utiliser une adresse MAC aléatoire pour votre adaptateur WiFi sous Windows 10. Optimisez votre sécurité en ligne!

Instructions pour désinstaller Internet Explorer sous Windows 10

Instructions pour désinstaller Internet Explorer sous Windows 10

Découvrez comment désinstaller Internet Explorer 11 sur Windows 10 pour optimiser l'espace de votre disque dur.

Comment utiliser Smart Defrag pour défragmenter efficacement les disques durs

Comment utiliser Smart Defrag pour défragmenter efficacement les disques durs

Découvrez comment utiliser Smart Defrag, un logiciel de défragmentation de disque dur gratuit et efficace, pour améliorer les performances de votre ordinateur.

Comment partager un VPN via un point daccès WiFi depuis un ordinateur portable

Comment partager un VPN via un point daccès WiFi depuis un ordinateur portable

Le moyen le plus simple de déverrouiller du contenu et de protéger tous les appareils avec un VPN crypté est de partager la connexion VPN via un point d