Introduction
I wanted to pin a windows store app to the taskbar. This is not supported in W8.0.
Script to Launch a Store App
After ample search I found a simple script on the internet to launch a store app, while the name app can be changed or be replaced by a parameter.
Code in the script.vbs file:
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.SendKeys "^{ESC}"
WScript.Sleep 100
objShell.SendKeys "PlayMyMusicFolders"
WScript.Sleep 100
objShell.SendKeys "{ENTER}"
And voila!
So I made a shortcut to the script.vbs file, changed the Icon, pinned the shortcut
to the taskbar and Voila! (that is almost French for ta-taah!) ...
The chosen icon is not shown on the taskbar, but instead an ugly .vbs icon is shown.
I suppose there are more elegant solutions, but if you are a hammer you see nails everywhere, so I made a minimal
C# program to run the script. Make a link to this program,
change the icon and pin this shortcut to the taskbar and Joepie! (that is Dutch for Jippeeh!) it works.
RunScriptDotVbs to Run script.vbs
Program RunScriptDotVbs.exe is a C# console application with in program.cs:
static void Main(string[] args)
{
string cmd= System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"Script.vbs");
var start = new System.Diagnostics.ProcessStartInfo();
start.FileName = cmd;
try
{
var process = System.Diagnostics.Process.Start(start);
}
catch
{
Console.WriteLine("No file Script.vbs found in current folder to run");
Console.WriteLine("Hit <Return> to exit");
Console.ReadLine();
}
}
Points of Interest