Windows shell extension registry keys allow you to copy and paste file paths with the backslashes changed to forward slashes.
These registry keys have embedded Powershell code to handle the clipboard and string replacement. Powershell 5 or greater is required to run this properly.
If you have Windows 10 or newer, your system should have Powershell 5 or greater already installed. If not, you will need to download it.
Powershell install documentation
Microsoft likes to depreciate links almost as much as they like to rename their products. If these links don't work, use your favorite search engine and get the latest version of Powershell.
Once you have Powershell installed:
- Download the SwitchSlashes.reg registry file.
- Run it (as administrator if needed).
- Click ok and you are done.
I have also included a registry file which will attempt to remove any keys added. Download and run Remove-SwitchSlashes.reg registry file.
The shell extensions work on Windows File Explorer by holding Shift and Right Clicking on a folder, in a folder, or on a file. You can then click the "Copy //" option in the context menu.
You may see a command prompt flash. This is normal. If you know of a way to prevent this let me know or create a pull request.
If you prefer to not hold Shift before your Right Click, simply open the SwitchSlashes.reg file in a text editor, and add a semicolon ; infront of the lines "Extended"="" and save.
If you have already installed the keys, run Remove-SwitchSlashes.reg to remove the old ones, then run the modified SwitchSlashes.reg.
If the "Copy //" option is not behaving as expected there are a couple things you can do.
-
Ensure you have powershell 5 or greater installed.
-
Check the install path of Powershell; it may be different on your machine, and require you to modify the SwitchSlashes.reg file.
Powershell will normally be located in
c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
If Powershell is not located in the path noted above:
- Copy the proper path to powershell.exe.
- Open SwitchSlashes.reg in a text editor.
- Locate the
[HKEY_CLASSES_ROOT ... SwitchSlashes.ForwardSlash\command]portions of the registry file. - Replace the path like so:
BEFORE: @="c:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe ...
AFTER: @="c:\\new\\path\\to\\powershell.exe ...
IMPORTANT: mind the double \\ backslashes. They are required when modifying the SwitchSlashes.reg file. If you are directly modifying the registry the double \\ backslashes are not required.
- Save the SwitchSlashes.reg file, run the Remove-SwitchSlashes.reg file if needed, and rerun SwitchSlashes.reg.
-
If all else fails, you can include -NoExit to the registry key commands like so:
BEFORE:
@="c:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe \"-command\" ...AFTER:
@="c:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit \"-command\" ...Save the SwitchSlashes.reg file, run the Remove-SwitchSlashes.reg file if needed, and rerun SwitchSlashes.reg.
Now, when the "Copy //" context menu option is pressed, the Powershell script will remain open and you can further debug the issue.