Originally published at: http://www.howtogeek.com/188920/how-to-put-short-notes-in-the-windows-taskbar/
There’s plenty of third-party programs and other widgets that may help you keep information close at hand. Here’s a neat trick to keep short notes or other small pieces of information accessible from the taskbar without any extra software.
Is there anyway to get the batch file to put a particular icon on the shortcut created?
One little nit. In your code example, you end up using smart quotes, and those need to be changed to dumb ASCII quotes. Otherwise the command doesn't work.
You can assign an icon to the template.lnk file by right clicking it in Explorer, choosing Properties, and choosing Change Icon in the Shortcut (default) tab. Can it be changed programmatically? Possibly, but I don't see it via a batch file. If you have a limited number of icons that you want to chose, you can just make copies of the batchfile using different template files, and set your template files up with different icons.
SET /P X=Text for note:
COPY "E:\Users\Bryan\Documents\Notes\Template1.lnk" "E:\Users\Bryan\Documents\Notes\Notes\%X%.lnk"
SET /P X=Text for note:
COPY "E:\Users\Bryan\Documents\Notes\Template2.lnk" "E:\Users\Bryan\Documents\Notes\Notes\%X%.lnk"
And so on.
You could call one makephone.cmd to make a phone icon, makeemail.cmd to make an email icon, and so forth.
Correct bytehead. That one nearly caught me too but I sorted it also.
Of course bytehead, I never thought of changing the icon in the template file lol... Sorted
As @bytehead said, there's really not a way to arbitrarily choose icons via a Batch file. Though PowerShell has many more features and capabilities, I doubt it's easy (if at all possible) to do it there, either.
The easiest thing to do if you want an icon choice is to create multiple template files with icons you expect to use often, and make a separate batch file for each template. You could also use a CHOICE command in your batch file to enable selection of a template without having to have separate batch files for each. (You'd still need separate templates for each preferred icon though.)
Yeah, if you want to get into PowerShell or VBS (I really was only looking at CMD.EXE...), you can manipulate the icon. If you know what you are doing.
Editing shortcut (.lnk) properties with PowerShell
You can stuff the icon and icon number in.
$shell = New-Object -COM WScript.Shell
$shortcut = $shell.CreateShortcut('c:\Fully\Qualified\Location\of\linkfile.lnk')
would set the icon to that used in the example in Windows 7.
Playing around with this has shown me that:
$shortcut = $shell.CreateShortcut('.\tempfile.lnk')
Will actually create the link on the root of C: drive. E:.\tempfile.lnk will put it on the root of E:
I really think one would be better off with multiple template files.
I took mine just one little step further. I use a Desktop Prog for texting via my mobile provider without having to go to their Website, it's called Cabbage. I included the path to that Prog in my Template file so when I open my Taskbar contact list, if I click on any of the numbers it opens the Cabbage Prog. Not perfect but at least I get a little more millage out of the shortcuts.
Have you looked into the documentation for the program? It might have a command-line option that allows you to shortcut creation of a new text (i.e.: pre-fill the phone number).
If so, you could use PowerShell per the instructions linked in @bytehead's post to custom-build those shortcuts. Alternatively, you could actually use a batch script to build other batch scripts (instead of shortcuts) that will do the same job. Or you could use a batch script to write those batch scripts, and put them into another folder, then make pretty shortcuts to the batch scripts in your taskbar folder.
What Jacob says. Command line options might make using Cabbage in this manner easier. Even if you have to manually manipulate the shortcuts after you create them, it's a one and done deal. Just make sure that you back them up once you've got them the way you want them.
This topic was automatically closed after 10 days. New replies are no longer allowed.