Tech Kraft

Documentum, AWS, Java, Ruby on Rails, Linux, Windows, App Servers


Windows: Create Batch file to copy text to clipboard

Here’s how you can create a batch file that will copy a one line text to the clipboard.

  • Open notepad or any text editor
  • Copy the following text into the empty file:
echo|set/p=<text_to_copy>|clip
  • Save the file with a .bat extension. Make sure there is no .txt at the end of it, just .bat.
  • Now, to copy the text, just double click the file from where it is saved. The <text_to_copy>, including the < and > signs, will be copied to the clipboard. You can then just paste the copied text where you want.


2 responses to “Windows: Create Batch file to copy text to clipboard”

  1. I have Windows 7 and I tried exactly this and It just didn´t work and it pasted always the same that I had copied before and not the text I set up in batch. In other words, the batch file does nothing. It launches for just a millisecond the command line, the command line closes itself and I have nothing copied. What am I doing wrong?

    Like

    1. Hi Petr,
      Can you paste the contents of your batch file here?

      Like

Leave a comment

About Me

Senior Software Engineer professional with over 16 years of success with multiple open source technologies and various Content Management platforms and solutions.

Proven technical abilities through numerous projects involving enterprise web application design and development, application installation, configuration and support, and workflow and collaboration system designs.

  • Ability to learn new technologies and platforms quickly and apply them to the task at hand.
  • Excellent analytical skills, and strong communication and collaboration abilities.
  • Technical emphasis in including but not limited to Java, Ruby on Rails, Documentum and Alfresco
    in both Linux and Windows based environments

Newsletter