When I open a new text file, I just want it to open with some lines in it like this which would come from some kind of Microsoft Windows template.
What is the Windows magic that will allow a rightclick context menuTry this link. Go down to the response that's had 75 up votes.
selection of "{rightclick} New | Text Document" to create those lines?
When I open a new text file, I just want it to open with some lines in it like this which would come from some kind of Microsoft Windows template.
=============================================================================
=============================================================================
=============================================================================
What is the Windows magic that will allow a rightclick context menu
selection of "{rightclick} New | Text Document" to create those lines?
I would use a batch to put the text into the Windows clipboard:
@echo off
(for /l %%i in (1,1,10) do @echo ==============================&echo.)|clip
Then, when editing a text file, just press <CTRL>-V (or <WIN>-V
if you have added more content to the clipboard) to insert the lines
at any position you like. The batch also could ask which one of
a collection of templates it should put into the clipboard.
When I open a new text file, I just want it to open with some lines in it like this which would come from some kind of Microsoft Windows template.
============================================================================= 12345678901234567890123456789012345678901234567890123456789012345678901234567 =============================================================================
=============================================================================
=============================================================================
=============================================================================
=============================================================================
=============================================================================
=============================================================================
=============================================================================
What is the Windows magic that will allow a rightclick context menu
selection of "{rightclick} New | Text Document" to create those lines?
I created C:\batchfiles\cliptext.bat containing the 3 lines below.
@echo off
REM cliptext.bat cliptext.bat seeds clipboard for subsequent paste
(for /l %%i in (1,1,10) do @echo &=============================================================================&echo.)|clip
Clicking on the batch file worked, but to make it a run command I added
this key to the registry to invoke it from the run box.
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cliptext.exe
But when created a shortcut to that batch file, Windows wouldn't allow me
to pin it to the taskbar.
On 15.10.2024 19:04, Wolf Greenblatt wrote:
I created C:\batchfiles\cliptext.bat containing the 3 lines below.
@echo off
REM cliptext.bat cliptext.bat seeds clipboard for subsequent paste
(for /l %%i in (1,1,10) do @echo &=============================================================================&echo.)|clip
Clicking on the batch file worked, but to make it a run command I added
this key to the registry to invoke it from the run box.
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cliptext.exe
But when created a shortcut to that batch file, Windows wouldn't allow me
to pin it to the taskbar.
Instead of messing around with shortcuts and the registry, I would
use a small exe to start the batch.
But when created a shortcut to that batch file, Windows wouldn't allow me >>> to pin it to the taskbar.
Instead of messing around with shortcuts and the registry, I would
use a small exe to start the batch.
It is even much simpler. Just rename cliptext.bat to cliptext.exe,
then you can drag&drop it to the taskbar. Then rename it back to cliptext.bat and right-click in the taskbar and change the link in
properties also to cliptext.bat.
It's this simple:
1. Pin *any* executable shortcut to the taskbar (for example, Notepad++)
2. Change the shortcut target to C:\batchfiles\cliptext.bat
That's it!
This is the current content of C:\batchfiles\cliptext.bat
@echo off
REM cliptext.bat seeds the clipboard for subsequent pastes
(for /l %%i in (1,1,10) do @echo &=============================================================================&echo.)|clip
I could have made a link to anything actually, but I was already using Notepad++ so I used that link (plus the icon is ok as it w/o changing it).
It's this simple:
1. Pin *any* executable shortcut to the taskbar (for example, Notepad++)
2. Change the shortcut target to C:\batchfiles\cliptext.bat
That's it!
It's this simple:
1. Pin *any* executable shortcut to the taskbar (for example, Notepad++)
But if you pin an exe (or a shortcut to an exe), which already has
an icon, to the taskbar, you can't later change the icon in the taskbar.
If you pin an exe without an icon, for example the renamed batch file (cliptext.bat -> cliptext.exe) to the taskbar, you can later add an
icon (for example the standard icon with 4 horizontal lines).
2. Change the shortcut target to C:\batchfiles\cliptext.bat
And change the icon to anything you like (but you can do this only
once).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 361 |
Nodes: | 16 (2 / 14) |
Uptime: | 123:21:48 |
Calls: | 7,716 |
Files: | 12,861 |
Messages: | 5,727,955 |