Windows Shell Automation InvokeVerb based on number instead of command string
<p>Normally shell automation InvokeVerb only accepts a string command, based on the documentation here: <a href="https://msdn.microsoft.com/en-us/library/ms723189(v=vs.85).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/ms723189(v=vs.85).aspx</a></p>

<p>However I noticed a cmd line EXE utility that accepts a number instead
<a href="http://www.technosys.net/products/utils/pintotaskbar" rel="nofollow">http://www.technosys.net/products/utils/pintotaskbar</a></p>

<p>This is interesting because in Windows 10 "&amp;Pin to taskbar" is removed from shell automation, despite being visible in the UI. ( <a href="https://connect.microsoft.com/PowerShell/feedback/details/1609288/pin-to-taskbar-no-longer-working-in-windows-10" rel="nofollow">https://connect.microsoft.com/PowerShell/feedback/details/1609288/pin-to-taskbar-no-longer-working-in-windows-10</a> )</p>

<p>However with this EXE passing the "number" 5386 as the command works.</p>

<p>I am interested to know what methods can be used to achieve this in either PowerShell/VBScript/.NET language or Win32 C/C++. </p>

<p>I understand this is almost certainly unsupported and likely to break any time as these numbers have changed between OS releases.</p>

<p>An example using the string version in PowerShell</p>

<pre><code>$filepath = "C:\windows\system32\notepad.exe"
$path = Split-Path $FilePath 
$shell= New-Object -com "Shell.Application"  
$folder=$shell.Namespace($path)    
$item = $folder.Parsename((split-path $FilePath -leaf)) 
$item.InvokeVerb("&amp;Pin to taskbar")
</code></pre>