Answer the question
In order to leave comments, you need to log in
How to programmatically pin a shortcut to the Win 10 Start Screen?
subj actually. preferably in C#. but C, PowerShell, CMD/BAT are also good, as long as it really works,
we are talking about a set of shortcuts already created by the program (well, or how to create a shortcut with pinning to "start" take out10). once upon a time, I found an example for C #, but it does not work
static void links2start()
{
dynamic sa = Activator.CreateInstance(Type.GetTypeFromProgID("Shell.Application"));
dynamic ll = sa.NameSpace(linkLocation);
dynamic lnk = ll.ParseName("body.lnk");
foreach (dynamic verb in lnk.Verbs)
if (verb.Name == "&Pin to Start")
verb.DoIt();
}
Answer the question
In order to leave comments, you need to log in
for c:\windows\system32\calc.exe first create a shortcut in C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs.
then turned around:
(New-Object -ComObject shell.application).namespace('c:\windows\system32\').parsename('calc.exe').invokeverb('pintostartscreen')
strange, but works like
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question