Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute PowerShell command on selected files in Explorer

How to execute a rename command in PowerShell only on selected files in Explorer? I have the PS command but I don't know where to put it in the Windows registry to be accessible in the right-click context menu in Explorer.

like image 966
Rayearth Avatar asked Oct 12 '25 21:10

Rayearth


1 Answers

HKCR:\*\shell contains what you need. Create a new key with the name of what you want to call it (eg "Rename With Date"), then a subkey called "Command" with a default value of your command.

So for example, HKCR:\*\shell\Rename With Date\Command where the (Default) value is PowerShell -Command Rename-Item "%1" ((Get-Date).ToShortDateString() + " - %1") or something should do the trick I think.

like image 195
Deadly-Bagel Avatar answered Oct 14 '25 16:10

Deadly-Bagel