Discussion:
Seedclip.bat batch file to seed Windows clipboard with known text (for subsequent pasting)
Add Reply
Wolf Greenblatt
2024-10-16 21:40:08 UTC
Reply
Permalink
Below is a process for seeding the Windows clipboard with text
such that the clipboard can easily be pasted into new text files.

The code was kindly proposed by Herbert Kleebauer on the Windows newsgroup
in response to this "New | Text Document" context thread earlier this week.
<https://www.novabbs.com/computers/article-flat.php?id=82159&group=alt.comp.os.windows-10#82159>

1. Create this sample/template "seedclip.bat.exe" exactly as shown below:
@echo off
REM seedclip.bat seeds the Windows clipboard for subsequent pastes
(for /l %%i in (1,1,10) do @echo =====================&echo.)|clip

2. Rightclick "seedclip.bat.exe" & select "Pin to taskbar".

3. Rightclick on the pinned icon & rightclick again to select "Properties"
& click the "Change icon" button to choose any desired available icon.

4. In the Windows file explorer, rename the batch file from
"seedclip.bat.exe" to "seedclip.bat" by removing the ".exe".

This step was needed because you can't pin a batch file to the taskbar.

5. Rightclick on the pinned icon & rightclick again to select "Properties"
to change the pinned icons's TARGET from "C:\whatever\seedclip.bat.exe"
to "C:\whatever\seedclip.bat".

6. Click on the pinned taskbar icon to seed the clipboard with text.
Then open a new text file and paste the clipboard to that file.

You're done.
Now you can see any new text file with the desired contents.

If desired, create a custom "seedclip" command for the Windows RunBox.

a. Rightclick on the App Paths key in the system registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
b. Create a new key called "seedclip.exe" & set the string value
Value =
c. To seed the Windows clipboard, just press the "Windows+R" sequence
to bring up the Windows RunBox and type "seedclip" & then hit Enter.

Please test this out and let me know what improvements you suggest.
Wolf Greenblatt
2024-10-17 14:23:24 UTC
Reply
Permalink
Post by Wolf Greenblatt
If desired, create a custom "seedclip" command for the Windows RunBox.
a. Rightclick on the App Paths key in the system registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
b. Create a new key called "seedclip.exe" & set the string value
Value =
c. To seed the Windows clipboard, just press the "Windows+R" sequence
to bring up the Windows RunBox and type "seedclip" & then hit Enter.
Oops. I had saved a spot for pasting the value but forgot to paste it.

If desired, create a custom "seedclip" command for the Windows RunBox.

a. Rightclick on the App Paths key in the system registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
b. Create a new key called "seedclip.exe" & set the string value
Key = seedclip.exe (note that the keyword must end with ".exe"
Value = C:\whatever\seedclip.bat
c. To seed the Windows clipboard, just press the "Windows+R" sequence
to bring up the Windows RunBox and type "seedclip" & then hit Enter.

Note that the "App Paths" key can point to more than just a batch file.
It can point to a shortcut or executable or any registered document type.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
Key = keyword1.exe (note that the keyword must end with ".exe"
Value = C:\whatever\file.lnk (the file doesn't have to match the keyword)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
Key = keyword2.exe (note that the keyword must end with ".exe"
Value = C:\whatever\file.exe (the file doesn't have to match the keyword)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
Key = keyword1.exe (note that the keyword must end with ".exe"
Value = C:\whatever\file.docx (the file type should be registered)

<https://helgeklein.com/blog/how-the-app-paths-registry-key-makes-windows-both-faster-and-safer/>
<https://docs.revenera.com/installshield22helplib/helplibrary/IHelpAddAppPathsToComponent.htm>
<https://superuser.com/questions/1642149/what-does-hklm-software-microsoft-windows-currentversion-app-paths-actually-do>
Tom Del Rosso
2024-10-26 23:45:27 UTC
Reply
Permalink
Post by Wolf Greenblatt
Below is a process for seeding the Windows clipboard with text
such that the clipboard can easily be pasted into new text files.
I have sometimes wanted to copy the whole contents of a command window
and save it in a file. A "tee" program is usually not sufficient. I
managed to do it with a mouse macro program, but a single command would
be ideal.
Post by Wolf Greenblatt
The code was kindly proposed by Herbert Kleebauer on the Windows
newsgroup in response to this "New | Text Document" context thread
earlier this week.
https://www.novabbs.com/computers/article-flat.php?id=82159&group=alt.comp.os.windows-10#82159
I wondered where Herbert went. He used to post in alt.msdos.batch.nt.
--
Defund the Thought Police
Herbert Kleebauer
2024-10-27 07:53:33 UTC
Reply
Permalink
Post by Tom Del Rosso
I have sometimes wanted to copy the whole contents of a command window
and save it in a file. A "tee" program is usually not sufficient. I
managed to do it with a mouse macro program, but a single command would
be ideal.
But with the new terminal window in WIN11 it is as simple as in
any GUI Windows program. Do a <SHIFT> mouse click on the
first character you want to copy, then scroll down the window
and do a <SHIFT> mouse click on the last character you want to
copy and then a <CTRL>-C to store it in the clipboard.
Post by Tom Del Rosso
I wondered where Herbert went. He used to post in alt.msdos.batch.nt.
alt.msdos.batch.nt is dead which is true also for the whole
usenet. Sad but true.
Kenny McCormack
2024-10-27 09:59:23 UTC
Reply
Permalink
In article <vfkrhu$5is5$***@dont-email.me>,
Herbert Kleebauer <***@unibwm.de> wrote:
...
Post by Herbert Kleebauer
alt.msdos.batch.nt is dead which is true also for the whole
usenet. Sad but true.
It can't be that dead, considering that you just posted to it.

(And so did I...)

(And by "It", I can (and am) referring both to this ng and to Usenet in
general...)
--
"Only a genius could lose a billion dollars running a casino."
"You know what they say: the house always loses."
"When life gives you lemons, don't pay taxes."
"Grab 'em by the p***y!"
Wolf Greenblatt
2024-11-08 03:38:50 UTC
Reply
Permalink
Post by Herbert Kleebauer
Post by Tom Del Rosso
I have sometimes wanted to copy the whole contents of a command window
and save it in a file. A "tee" program is usually not sufficient. I
managed to do it with a mouse macro program, but a single command would
be ideal.
But with the new terminal window in WIN11 it is as simple as in
any GUI Windows program. Do a <SHIFT> mouse click on the
first character you want to copy, then scroll down the window
and do a <SHIFT> mouse click on the last character you want to
copy and then a <CTRL>-C to store it in the clipboard.
Thanks to Herbert Kleebauer's prior suggestions, I have a series of
template-creating batch files now, all invoked easily in a Runbox.

When I want template #1 for example, I type "1" in the Runbox.
When I want template #2, I type "2"; "3" for template #3, etc.

All the batch files are the same - they just seed a different template into
the Windows clipboard using the "pipe to clip" Herbert had suggested.

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\1.exe
@Default = c:\path\seedclip_template1.bat
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\2.exe
@Default = c:\path\seedclip_template2.bat
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\3.exe
@Default = c:\path\seedclip_template3.bat

Where the general form of the "seed to clip" for templates is

@echo off
REM This seeds the Windows clipboard for subsequent pastes
type C:\path\template.txt|clip

When you are in any file, you just type "1" into the Runbox,
and then you Control+V the template from the clipboard into it.

The nice thing is you can create delimiter templates of any length with
subsequent pastes, so you only really need one set of delimiters.
@echo off
REM seedclip.bat seeds the Windows clipboard for subsequent pastes
(for /l %%i in (1,1,10) do @echo =============================================================================&echo.)|clip

I am still using Herbert's spelling alt.msdos.bat program which
verbally challenges you to spell all the words that you misspell!
~
~

Loading...