How to make 'copy as path' appear in Windows Explorer context menu without shift key?

Solution 1:

This script works (tested on Windows 10) without invoking command prompt:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Allfilesystemobjects\shell\windows.copyaspath]
@="Copy &as path"
"Icon"="imageres.dll,-5302"
"InvokeCommandOnSelection"=dword:00000001
"VerbHandler"="{f3d06e7c-1e45-4a26-847e-f9fcdee59be0}"
"VerbName"="copyaspath"

It also assigns a as the hotkey on the context menu, so RightClick+a copies the file path.

Bonus: Script to remove the above setting:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Allfilesystemobjects\shell\windows.copyaspath]

Script Credits

Screenshot from Windows 10 Enterprise v1809 build 17763.437: Copy as Path

Solution 2:

AskVG here has a perfect solution. Though it says Windows 7, I've tried it on my Windows 10 PC and it works.

You can download the registry script straightaway from here. I've tested it and it contains no malicious code.


To prevent link rot, here are the contents of the REG file. Save the following as copyaspath.reg and then double-click to run.

Windows Registry Editor Version 5.00

;Created by Vishal Gupta for AskVG.com

[HKEY_CLASSES_ROOT\*\shell\Copy as Path]

[HKEY_CLASSES_ROOT\*\shell\Copy as Path\command]
@="cmd.exe /c echo | set /p=\"\"%1\"\"|clip"

[HKEY_CLASSES_ROOT\Directory\shell\Copy as Path]

[HKEY_CLASSES_ROOT\Directory\shell\Copy as Path\command]
@="cmd.exe /c echo | set /p=\"\"%1\"\"|clip"

Kudos to @chunk_split for a workaround to remove the newline.