0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

クリップボードにコピーするバッチ【Windows】

Posted at

1.はじめに

クリップボードに指定単語をコピーするためのバッチ
スタートアップフォルダに配置するとWindows + R で実行できて便利

2.クリップボードにコピーバッチ(改行あり)

clip.bat
rem クリップボードにコピー(改行あり)
echo abcde! | clip
  • remはコメント
  • echoは標準出力
  • clipでクリップボードにコピー
  • 最後に改行が含まれた状態でクリップボードにコピーされる

実行結果

abcde!

3.クリップボードにコピーバッチ(改行なし)

clip2.bat
rem クリップボードにコピー(改行なし)
SET /P <NUL = "abcde!" | clip
  • remはコメント
  • SET /P <NUL = "" で改行なし(""で囲わないと半角スペースが入るかも)
  • clipでクリップボードにコピー
  • 改行なしの状態でクリップボードにコピーされる

実行結果

abcde!
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?