When using the built-in Copy as Path context menu option or the Copy Path ribbon button to copy file names to clipboard, the output would contain quotes for file/folder name paths, such as below.
There are some situations where you don’t need quotes whether the file names contain spaces or not. To accomplish that, you can add your own Copy as Path option using a custom script and access it from the Send To menu.
Copy Path without Quotes
I made a script that does that, making use of the excellent NirCmd, multi-purpose command-line automation tool. Optionally, the script can also be modified to copy file paths in URI format if required.
- Download NirCmd from Nirsoft.net and extract
NirCmd.exeto your Windows folder.
- Download the
copy_as_path.vbsVBScript shown below.
- Move the script to a permanent location such as
C:\Windowsor anywhere you prefer.
- Double-click the script so that it adds a shortcut to the Send To folder automatically. You need to do this only for the first time.
- Now, select the files/folders, click Send To and click Copy as Path
This copies the file/folder paths to Clipboard without quotes.
How to Copy Paths in URI format?
You can choose to copy file paths in URI format like the one below.
To do so, edit the script file (.vbs) using Notepad and change the following line:
CopyAsURI = 0
CopyAsURI = 1
And save the script file.
Select the files/folders, click Send To and click Copy as Path. File/folder paths would now be copied in URI format.
I hope you find these scripts useful and productive. Let’s know your comments.