how to create a batch file that can copy text

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

the code:

@echo off
:home
cls
echo | set/p="[your text here]" | clip

Jebbidan
Автор

Thanks for the video, as other have mentioned would be cool to see one including paste command.

patienceman
Автор

I like to make batch files too, but i have no Windows. I have an Android tablet with a Dosbox app installed to run DOS batch files. (Dosbox is an emulator that emulates a DOS PC with CPU, RAM and much more.) It is a little different from Windows batch files. In DOS we have no clipboard and not the set command from Windows.

In DOS we have to use a choice command for input. But we can also use an attached parameter to start a batch file. Example: COLOR.BAT 1b

Inside of the COLOR.BAT we can get the color with using %1 for the first attached parameter and if we attache two parameter the second parameter is in %2 and so on third in %3....

Example:

@echo off
REM TEST.BAT
echo %1
echo %2
echo %3

Start with
TEST.BAT apple pear banana

....

And i also like to use some pipe operators(> >>) for to redirect the content of some echo commands into a new text file. The first > create a new text file on the current drive/folder and the following >> add new lines to the text file. Example:

@echo off
REM TEST.BAT
echo first line>test.txt
echo second line>>test.txt
echo third line>>test.txt

You can use it with Windows batch files too. Please let me no if you like it.

maxmuster
Автор

HOW DO I USE CONTROL V IN BATCH SCRIPT???

eziorealestate
Автор

Great video. I am looking to create a batch file that will paste once sentence. Do you have a video for this? Name?

sciencesleuth
Автор

I would love some help. I'm pretty noobz.

Is there a way to get multiple blocks of texts to function? ie: is there some code for a carriage return and/or next line?

I have full functionality of the bat...but when I start adding carriage returns, it just breaks the whole code. If I eliminate all carriage returns, and leave the whole text block as one continuous unit, works just fine...special characters and all.

I'm imagining the is some character to force a carriage return...like some <br> equivalent

derricksmash
Автор

How to replace my copied text with custom text

HamzaKhan-omgi
Автор

ECHO | SET /P=yourtexthere | CLIP just this line is better

cmkiller