Batch output string to the Windows clipboard

Source: Internet
Author: User

batch output string to the Windows clipboard2016-06-30 23:29 339 people read Comments (0) favorite reports

Copyright notice: n3verl4nd Source: Http://blog.csdn.net/x_iya

With the help of Clip.exe (C:\Windows\System32\clip.exe)

[CPP]View PlainCopy  
  1. C:\windows\system32>clip/?
  2. CLIP
  3. Describe:
  4. Redirects the output of the command-line tool to the Windows Clipboard. This text output can be pasted
  5. to other programs.
  6. Parameter list:
  7. /? Displays this help message.
  8. Example:
  9. DIR | Clip places a copy of the current directory list into the Windows clipboard.
  10. CLIP < README. TXT places a copy of the Readme.txt into the Windows clipboard.
  11. C:\windows\system32>


Method One:

[CPP]View PlainCopy 
    1. Echo I am a student |clip
At this time the string one more carriage return line wrap

Method Two:

[CPP]View PlainCopy 
    1. set/p="I am a Student" <nul | clip

For example, the current date is stored on the clipboard:

[CPP]View PlainCopy 
    1. set/p="%date%" <nul | clip

Method Three: (VBS)

[CPP]View PlainCopy 
    1. Mshta vbscript:clipboarddata.setdata ("text","I am A Student") (close)

Batch output string to the Windows clipboard

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.