Originally published at: http://www.howtogeek.com/163968/add-the-ability-to-copy-the-contents-of-any-text-file-to-your-send-to-menu/
We have previously covered how to add the ability to copy the contents of a TXT file to the right-click context menu, however this method would require you to create a separate registry entry for each type of file you wanted the ability to do this with (e.g. JS, BAT, LOG, HTM, CSS, etc.).
I'm curious as to what anyone would need this for. Copying a .txt file to clipboard is straightforward, and opening a .txt file and Ctrl+A, Ctrl+C copies the contents quickly. Why would you want to use the right-click-filename-SendTo-Clipboard (as contents) function?
Not knocking it AT ALL. Just interested in the peeps' applications for this new shortcut.
Wisewiz (the elder)
Two reasons, Dan.
1) it actually is marginally faster in some contexts
2) it's a cool way to illustrate several concepts that will be instructive to many (okay, not THAT many) people
I'm going to do it on one box just for a fun little exercise
When you have to do this for several files, it can save a bit of time.
I modified the short cut so that it sends a directory listing to the clip board. There are many times I want to 'ls DIRNAME >list.txt' when I don't have a cmd window handy.
My short cut is to a batch file, dirList.bat that contains
dir %1% | clip
Now I can right click on a directory name and send the directory listing to the clip board.
Thanks for the tip.
anth, you're absolutely right on both counts (well, except that when I used it to get bat file contents from one comp to another, to paste into a bat I was developing, it was WAY faster, not marginally, than copying the bat file from machine to machine, opening it in a text editor, selecting, copying, and then pasting into the other bat file, and then closing the used bat file). And these forums have a teaching function above all else, I believe.
faulkner132, I tried it, and I liked it.
And dr838, I put yours on my new boxes instead of installing a third-party PrintFolder program. Works for me.
Thanks to you guys and HTG.