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
- C:\windows\system32>clip/?
- CLIP
- Describe:
- Redirects the output of the command-line tool to the Windows Clipboard. This text output can be pasted
- to other programs.
- Parameter list:
- /? Displays this help message.
- Example:
- DIR | Clip places a copy of the current directory list into the Windows clipboard.
- CLIP < README. TXT places a copy of the Readme.txt into the Windows clipboard.
- C:\windows\system32>
Method One:
[CPP]View PlainCopy
- Echo I am a student |clip
At this time the string one more carriage return line wrap
Method Two:
[CPP]View PlainCopy
- set/p="I am a Student" <nul | clip
For example, the current date is stored on the clipboard:
[CPP]View PlainCopy
- set/p="%date%" <nul | clip
Method Three: (VBS)
[CPP]View PlainCopy
- Mshta vbscript:clipboarddata.setdata ("text","I am A Student") (close)
Batch output string to the Windows clipboard