Back in May, I wrote about ways to create your own keyboard shortcuts
(Click here to see that post). A reader of that post posed the following question:
Do you know how to create another type of shortcut? I want to have my email address entered with a Ctrl + something.
Normally, I don’t post articles two days in a row, but I wanted to get the reader the response, and this isn’t something that I can copy/paste into an e-mail, then post later. So, this week we’re having a rare ‘two days in a row’ posting.
Well, it took a bit of digging, but we found a way to add your e-mail address to the clipboard with shortcut keystrokes, then you can use CTRL+V to paste the e-mail anywhere you need it.
NOTE: This assumes that the reader is using Windows 7. For readers who are still on Windows XP, you’ll need to incorporate another program (http://www.nirsoft.net/utils/nircmd.html) to add the information to the clipboard (using the “Add the text content of clipboard to info1.txt” related command because Windows XP does not recognize the ‘clip’ command used in the batch file below).
So…Windows 7 users, continue on! Windows XP users, I’ll make a note below where you’ll need to install/reference the additional program.
First, open up Notepad by going to “Start, All Programs, Accessories”, then selecting ‘Notepad’.
Enter your e-mail address (or any other text that you want copied to your clipboard using the shortcut you’re going to create), then save the file to a location of your choosing as shown below by selecting “File, Save As” from the toolbar:
(click on any image to see a larger version of the image)
Next, open up a new document in ‘Notepad’.
Type in the following two lines (or copy/paste from below):
C:\Windows\System32\cmd.exe /k clip < c:\Converted\test.txt
c:\exit
Substitute the location/name of your text file for the portion of the code which reads ‘c:\Converted\test.txt‘. Everything else should match what is typed above exactly.
Windows XP users, assuming you have downloaded and installed the NirCmd utility, you would substitute the following line:
nircmd.exe clipboard readfile “c:\My Files\info1.txt”
for the first line (C:\Windows\System32\cmd.exe /k clip < c:\Converted\test.txt) above. Everything else should be the same.
Save the newly created file to whatever location you want, but change the extension to ‘.bat’ instead of ‘.txt’. By this, I mean that you go to “File, Save As”, select a location, then name the file ‘whatever_you_want.bat’ where you substitute your own word for ‘whatever_you_want’, but be sure to end it as ‘.bat’ in the ‘filename’ location. In the sample below, it is being named ‘test.bat’.
At this point, you’ve created the files which will place your e-mail address on the clipboard. Now, you have to create a shortcut, and assign keystroke shortcuts to that shortcut.
So now, go to your Desktop (or any other location you want to create your shortcut). Right-click in blank space (i.e. not when you’re hovering over any other files/icons) and navigate to “New, Create Shortcut” as shown in the image below.
This will take you into the ‘Create Shortcut’ wizard.
Use the ‘Browse’ tool to locate the batch file that you just created above (the one ending in .bat, NOT the one ending in .txt).
Next, enter the title you want on this shortcut.
When you press ‘Finish’, the newly created shortcut will appear on your Desktop, or in the chosen folder.
Hang in there…you’re almost done!
Right-click your newly minted shortcut and select ‘Properties’
The field labeled ‘Shortcut Key’ will read ‘None’ when you first see it. Click into the field, and press whichever letter you’d like to have the shortcut execute (in the sample, I pressed the ‘A’ key – nothing else). Windows will automatically fill in CTRL+ALT.
Click ‘OK’ to save your setup.
Now, when you press the CTRL+ALT+A keys on your keyboard (regardless of where you are), whatever is in the txt file that you created will be copied to the clipboard. If I now open a blank Word document (or put my cursor in the ’email’ field of a website), and press CTRL+V, the e-mail (or whatever I had stored in that text file) will paste into that location.
Voila!! You’ve created your own mini program which allows you to have a keyboard shortcut to entering your e-mail address (or any other information you need to enter frequently).
62 Comments
Hi Sandra!
A little late but hope you can still help me.. when i go to properties and try to change the “none” to a letter or whatever… i can`t! The computer won`t let me select, erase, change, etc. the “none” word.
I guess I did something wrong (btw im using Windows 10), hope you can help me.
Thanks in advance!
Hi, Sharon –
Sorry I’m late, as well. For some reason, my Blog isn’t notifying me when a comment is posted – guess I’ll have to figure out why and write about that, too :-).
It also took me a little bit of digging, but I found the answer. In Windows 10, you have to first start as an ‘Administrator’. Not just on your logged in User, but the ‘elevated’ Administrator which is hidden a bit.
I found this article about creating shortcuts on Windows 10 – combine that with the ’email’ idea in my original post, and you should be good to go!
Creating Keyboard Shortcuts in Windows 10
Let me know how you make out!
Sandy
Works!
Thank you! Thank you!
Why clutter the disk with unnecessary files??
Create the shortcut with this target line
“cmd.exe /c echo myemail@domain.com|clip”
This works really slick. Just make sure that you don’t put any spaces before or after the “Pipe” character (|). After creating it, I dragged it to the taskbar, so I can run it with a single click.
Thanks for this great idea. I’m on windows 10 and when I click on the shortcut it works. But when I’m trying to do it with the keyboard shortcut, it doesn’t. Any ideas?
I followed the steps and the first shortcut works great, but when I followed the same steps again to create a second shortcut, both shortcuts no longer work. Can you create multiple shortcuts and with the same steps?
Sorry for the delay in responding, but we’ve had illness in the family.
You SHOULD be able to do as many shortcuts as you like, HOWEVER, you need to use DIFFERENT hot key combinations when assigning the second combination. So, for example, if you used CTRL+ALT+T to the first shortcut, you need to assign CTRL+ALT+Y to the second.
Wonderful….
Its Really Works and a Good Idea to paste your desired test whenever you needed that. Just use the shortcut and Paste the text. Great and Many Thanks for sharing..
Hafeez ur Rehman
PAKISTAN
thanks a lot. It just works fine under windows 8.1
🙂
Hi,
I want to know how to use these shortcut keys for different text phrases to paste another document r webpage is there any other solution for this… I tried your script in windows xp but I didn’t installed nir.exe and it wasn’t worked properly.. Without nir cmd.exe in windows xp can we able to create shortcut keys for text phrases?.. Plz suggest me how to create different text phrases with different keys to paste in another source
Hi, Bharath –
You would set up a series of different batch files – each with it’s own phrase that you want to be able to copy.
I am not aware of any other way to handle Windows XP other than the one we detailed. Since Windows XP is no longer supported, we no longer spend time documenting ‘how to’s’ for it.
Sorry I can’t be of any more use.
Thanks a million. Always wanted to save my emails and login IDs for pasting.
Great help.
can you make it paste too?
I haven’t found a way to do that yet because of something called ‘focus’…basically, you have to click where you want the results to show up and press CTRL+V (hold down the Control key and click ‘V’ while the Control key is pressed).
Oh great, that post didn’t display properly. There’s a bit missing.
Your e-mail address goes after dummyName (I tried to put that in chevrons but that must get edited out by this blog engine).
Just copy the example and it will work.
Cheers.
Thanks, DaveyB!!!
I’ve taken this a step further (Windows 7 – I haven’t tested elsewhere), doing it with one file.
Create a .bat file containing this one line:
echo | set /p dummyName=| clip
For example:
echo | set /p dummyName=fred@fred.co.uk| clip
Make sure there are no spaces either side of your e-mail address.
Create a shortcut to this file and set the keyboard shortcut as before.
Cheers.
Please see correction in next post.
Hello.
I did it, worked perfectly.
I would want to know 2 things:
1.- When i press the shortcut, I lose the “prompt” of the window (i use it to chat, when i press my combination of keys, I lose the posibility to keep writing), is there a command to get the cursor back where it was?
2.- Is there a command to do the PASTE also after copying it? (To do this, I need 1.- to be solved)
Sorry for my english, thanks!
PS: I thoght maybe it could copy, then “ALT+TAB” then “ALT+TAB” again (to gain the prompt in my writing window) and then paste. But I don’t know how to send the command of alt+tab either :S
Hi! First, please NEVER apologize for your English…it is excellent. I can only speak one language, so you are WAY AHEAD of me!!! I’m very impressed.
As to your questions…
I am going to have to research #1. What you want is to ‘get focus’ back to the original document/screen where you were BEFORE you used your shortcut keystrokes. I’ll poke around and see if I can find something, but it might take me a little while to find a solution (if there is one out there).
Next, if you manually click back into the location you want to be in (for example, click back to your chat box and then click the spot where you want to do the insertion), then press CTRL+V and it will paste whatever you have from your txt file into that location. CTRL+V will ALWAYS paste what’s on the clipboard into the location of the cursor.
Hopefully, you’ll be hearing from me with news on the ‘focus’ issue. Wish me luck finding a solution!
Sandy
Thanks!
I hope you’re lucky!
About the CTRL+V, yes, it works.
Thanks in advance!
It’s all about finding the correct ‘keywords’ for the search!!!
Hi, again-
Just wanted to let you know that I didn’t forget you, but that I’m having a hard time finding a solution. Basically, it appears that the “focus” (i.e. where the mouse ends up) is not controllable (at least not by mere mortals such as ourselves) from a batch file. That is controlled by the system itself, so that one needs a keystroke emulator to do what you want. That said, I haven’t had success yet, but I continue to look. In the meantime, I’m afraid that the need to click to return control of the mouse to the field you want may be required. If I find something else, I’ll update you here.
Thanks much for this.
I’m having a slight problem…FYI, I know nothing about programming…
So, I did as you said above, however when I hit ctrl-alt-E, it opens the notepad where I put my email address, but doesn’t paste it into document. I’m running windows 8
I’m assuming I messed up the .bat file somehow?
This is what I have
C:\Windows\System32\cmd.exe /k clip < C:\Users\name\Documents\email-address.txt
C:\exit
I followed what you posted to Hamish about the shortcut target/start-in, so I think that's good.
Any help would be appreciated!
Hi, Christy!
Don’t worry…I’m not a programmer either…that’s why I like doing these posts…I try to make things accessible to ‘mere mortals’, like us!
I hadn’t tested this on Windows 8 before, but it appears to work the same…so, let’s see if we can figure out what your issue is.
Since the Notepad document with the email address in it opens, my first guess is that your shortcut points to the txt file, rather than the bat file. Right-click on the shortcut that’s probably on your Desktop, then click ‘Properties’. Look at the ‘Target’ area…does it list your txt file instead of the bat file? The bat file should be in the shortcut…something like ‘C:\transfers\test.bat’ as opposed to ‘C:\transfers\test.txt’.
Let me know if this solves your problem…if not, I’ll try to think of what else might be messing things up.
Hi Sandra, Still trying to follow your instructions as per above. Thought I had got there but when I press Clt + Alt + E as chosen in an E/mail address I get the Blk Command box stating that ‘the system cannot find the path specified’. In the shortcut I have it says that the target is C:\Windows\System32\cmd.exe/k clip<c:Converted\test.bit
Is this wrong? Don'r forget that you are dealing with a non-technical person that doesn't know a Modem from a Monitor! Rgds, Hamish
Hi, Hamish! Sorry I didn’t get back to you faster…my blog has decided that it will NOT email me when someone has posted a comment, so I have to check when I’m at my desk and I have been traveling. To get to your issue…
The ‘Start In’ field should be:
C:\Windows\System32
When you right-click the shortcut icon, the target should be something like:
C:\Your_File_Folder\your_batch_file.bat
The ‘Start In’ should look just like above…nothing different…the ‘Target’ field shouldn’t look exactly like what I’ve written above, but rather, the ‘C:\Your_File_Folder’ should be inserted with the path to the specific batch file you created, and the ‘your_batch_file.bat’ should be substituted with the name of YOUR batch file (it SHOULD end with .bat).
How do you find the path of your batch file? Using Windows Explorer (or click on My Computer or Documents), drill down until you can see the file that is your batch file (the one ending in .bat) listed on the screen. Once you are there, you should see a line below the icons at the top of your screen and above the list of files. Click in that line (sort of looks like the URL line on a web-browser). It will switch from saying something like ‘This PC > Documents > Something Else’ to something like ‘C:\Users\Sandra\Documents\E-Bay 2015’ where your user name is inserted and your folder structure replaces the ‘E-Bay 2015’ or ‘Documents\E-Bay 2015’. That is the path to your batch file. That is the start of your ‘Target’ line. Then, after you enter that path into the Target of your shortcut, enter the name of the batch file (it will be ‘something.bat’, maybe you called it ’email.bat’).
Save that and see what happens!!!
Good luck!
Sandy
P.S. If this doesn’t work, switch back to email – it will be easier for me to send you screen shots.
Hi Sandra, Yes, I have to agree with you…where does time go to?
You asked which system I am using..Windows 7 & yes I am an Administrator. this is my home computer. Nothing to do with working for someone. I shall remind you of my original query. I was looking for a shortcut to add, with 1 click, my E/mail address to forms I fill in. Thanks, Hamish
Hi, Hamish – I did a little poking around, and on my current computer (which happens to be Windows 8.1) I get what you have (only four tabs – General, Security, Details & Previous Versions – when the icon on the Desktop is NOT a SHORTCUT icon. When the icon on the Desktop IS a shortcut icon (you know, it has that little arrow at the corner), then the choices change – I might not have as many tabs as were shown in the original post, but one of them is the tab labeled ‘Shortcut’.
So, I think that the issue is that you’re trying to create the hotkey off of the ORIGINAL document icon, rather than from a SHORTCUT to the icon. Make sure that you’re original document is somewhere (like in My Documents), then create the shortcut (as illustrated above) on the DESKTOP. See if that works.
Sandy
Hi Sandra, I followed your instructions re shortcut but when rght press to properties on Shortcut on Desktop, I get a different page to yours. Mine only has 4 headings. General, Security, Details & Previous Versions, whereas your page had numerous headings. I am using Windows 7. thanks
Hi – Sorry…I’ve been away from the Blog…What version of Windows are you using? Are you an Administrator on that machine, or is this a company machine where security is tightly controlled?
Any idea if I can do this for windows 8.1?
I realize this is an older article, but I just set it up on a Windows7 PC following your steps and it worked perfectly. Thank you!
Thanks for another fantastic post. The place else may just anybody
get that kind of information in such an ideal way of writing?
I have a presentation next week, and I am at the look for
such info.
I’m not that much of a internet reader to be honest but your sites really nice, keep it up!
I’ll go ahead and bookmark your website to come back in the future.
Many thanks
Awesome article.
Thanks for this handy tip Sandra. I found I had to put the final keyboard shortcut on the desktop too or it did not always find the bat file and didn’t override what was already on clipboard.
thanks no longer have to type in annoyingly long password
Thanks, this worked well for a password that I have no control over.
now control//alt/f and control/v types in the password
which is quicker than opening up the .txt file on my desktop where i stored it (or any of my other password retrieval things)
I am trying to assign a shortcut key to my email address. I followed your instructions and when I hit ctl-v to paste I get a set of numbers instead of the address.
Spot on, thanks.
Thanks for the instructions. I, like Sinbar, had problems getting the hotkey to work, until I moved the shortcut to the desktop. Windows doesn’t appear to pick up the hotkey if it is in a regular folder, even if the shortcut is granted admin permissions.
Hi, Alice – That’s a great observation. You’re right…whenever I ran tests, I ALWAYS had the shortcut on the desktop. Thanks for sharing. Sandy
Thanks Sandra for your prompt response. However, it is not working for me, whatever I tried. I googled it and, true, many others have similar problems, for various reasons. Worst case scenario, I can still double click the batch file or it shortcut 🙂
Sorry about that…unfortunately, I can’t fix Microsoft :-). Personally, I think its a shame that people can’t get it to work because it is a terrific trick. It works consistently for me on two computers, so I can’t even duplicate the issue to try to trouble-shoot. Keep checking the Microsoft message boards, or post on their site…maybe if enough people complain, the issue will be patched (hope springs eternal!). Good luck
Sandra
I followed your directions and created a shortcut for my address. I created the batch file, shortcut to the batch file and also assigned a hot key (ctrl+alt+A) to the shortcut.
When I double click the batch file or it shortcut, it works fine and I can paste the address. However, the hotkey is not working at all. I tried to assign other hotkeys but none worked. I have Windows 7 64 bits.
Any suggestions?
Hi! Sorry that it’s not working for you. I just repeated the steps myself (since it’s been a while and I couldn’t remember the exact steps, so I followed the post myself), and it worked just find. Like you, I’m running a Windows 7, 64-bit machine. So, why don’t you try reassigning the hotkey. Try something different than ‘ctrl+alt+a’. Maybe that will do it. If not, I’d try Googling ‘hot keys don’t work’. When I did that, I found all kinds of people where some hotkeys worked, others didn’t, or none did, or whatever. At quick glance, it seems that some Windows updates (or lack thereof) may affect hotkeys and their functionality. Sometimes it appears to be the keyboard itself. I’m so NOT a hardware person, that I don’t want to give you errant advice. Good luck, and please let me know if/when you manage to solve the problem. We’d all like to know.
UPDATE: I DO NOTE that I have to click back onto the document, into the field, whatever, after hitting the hotkey combination for the ‘paste’ to work. So, I hit the hotkey combo, then I click back to where I want it pasted, and hit CTRL+V. Then, it works. It doesn’t if I don’t ‘relocate’ the cursor after hitting the hotkey combo.
Thanks indeed!, this is exactly what I’ve been looking for!
Hello! I’m happy to have found this. Thank you. I have one question: I would like to create two of these but only one seems to “stick”. I’ve tried variations on Ctrl + ‘different keys’ to no avail. Any advice?
Hi, Susie –
Thanks for visiting. Glad that this helped (sort of). Two comments/questions:
1. Did you create a separate txt file for each command? They need to be separate documents.
2. Did you only use CTRL+’something’ or did you try CTRL+ALT+’something’? MANY (if not all) of the CTRL+’something’ key combinations are already taken. Try adding CTRL+Shift or CTRL+Alt and see if you get the results that you’re looking for.
Good luck!
Sandy
This does work for me, all except the hotkey portion of the process. I seem to need to physically click the shortcut to the bat file in order to get the info onto the clipboard. Then it copies onto the clipboard perfectly. Is it possible that my hotkey is somehow turned off? All other windows hotkeys work fine. Ty and be safe.
Hi, Dave – I apologize for the VERY tardy response. The spam-filter on comments had ‘eaten’ this one and I just now went through clearing them out. Once you have hit the hotkeys, you must then right-click and PASTE to get the information to paste onto the document or into whatever space you want it to go. In other words, pressing the hotkey combo is step #1. Pressing Paste is step #2. Hopefully, that works for you.
thanks so much Sandra, this is going to help me a lot.
Do you have a spam issue on this blog; I also am a blogger, and I was wondering your situation;
we have created some nice procedures and we are looking to swap strategies with other folks, why
not shoot me an email if interested.
Hi!
Spam was a terrible issue, but we utilize Akismet and it has stopped virtually ALL of the spam. It is a subscription service, but to us it is well worth the price. If you want more information, please drop a note.
Sandy
similar but for a range of cells – i.e. multiple lines of data
Private Sub CommandButton2_Click()
Selection.Copy ‘ copies data to clipboard
End Sub
this will copy the contents of the range of cells to the clipboard which should enable you to subsequently paste the text using CONTROL V
You could create an Excel spreadsheet with any data you regularly copy – e.g. email addresses. Create a single macro button with the the code below.
Private Sub CommandButton1_Click()
t1 = ActiveCell.Value ‘ for info only
ActiveCell.Copy
End Sub
this will copy the contents of the active cell to the clipboard which should enable you to subsequently paste the text using CONTROL V
Thanks, Peter…you are right. There are always so many ways to solve a problem, aren’t there?
Sandy, does excel have to be open/running for the macro to work?
Hi, Startac!
No, nothing needs to be open for the hotkey combination to work. Simply press the hotkey combination, then right-click and Paste the information from the hotkey selection into whatever document you want. The hotkey combo does the ‘copy’. The Paste does, well, the paste, and will work into any type of document/web page, whatever.
Sandy
I liked your article is an interesting technology
thanks to google I found you