Since at least Windows 7, Windows comes with a commandline tool called clip.exe.
It puts a file or a line into the clipboard.
I use it to write very simple code generators; for instance you can call it from a .BAT file to fill the clipboard; so all you have to do after that is press ctrl v or shift insert in your editor and there’s your generated code snippet.
So why not use MSVC’s macro facility or Eclipse’s XTEXT? Well they’re sure nice tools but I have to switch dev environs so often I need something even simpler and IDE-independent so that’s why.