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.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
3 thoughts on “How to Copy as Path Without Quotes or in File URI Format”
‘To copy file names in URI format, change the following value to 1
CopyAsURI = 1 <— change 1 to 0 for this article
The copy of the script copy_as_path.vbs posted in the blog link above has CopyAsURI set to 1 (URI format) when it should be set to 0 if the user is trying to follow your steps 1-5 to generate paths without quotes as discussed in this article.
Note: The copy on github is the setup for URI format but specifically says so in the description.
@David: thanks for the heads up. It’s now updated.
Thanks for the Script! useful!