0

Hello can someone please help me to find an alternative to this code in C# wpf.

With WScript.CreateObject("Shell.Application")
    With .Namespace(objFSO.GetParentFolderName(objFile))
        .ParseName(objFSO.GetFileName(objFile)).InvokeVerb("{:}")
    End With
End With

I can't find an equivalent in C# for InvokeVerb("{:}"). Can someone tell me at least what these lines are doing?

Thanks anyway :D

Mathieu Guindon
  • 69,817
  • 8
  • 107
  • 235
Greenkiller
  • 200
  • 2
  • 12
  • 2
    Hard to say without a little more code for context. Perhaps related to [pinning an item to the taskbar](https://stackoverflow.com/questions/31720595/pin-program-to-taskbar-using-ps-in-windows-10/38880235#38880235)? – ashleedawg Mar 28 '18 at 19:22
  • @ashleedawg wow your Google-fu is impressive! It's gotta be it! – Mathieu Guindon Mar 28 '18 at 19:23
  • Yes this is exactly what I am trying to do. The others lines I understand how it works and how to do it in C# but not these 5 lines – Greenkiller Mar 28 '18 at 19:24
  • Well then, that code is pinning `objFile` to the task bar – Mathieu Guindon Mar 28 '18 at 19:25
  • I just want to know how to do an invokeverb("{:}") in C# – Greenkiller Mar 28 '18 at 19:26
  • lol, I've been a longtime beleiver that Google skill is more important than Coding skill, and should be the centre of Coding 101. In my opinion, the secret to coding-related Google-fu is always choosing **`Tools`→ `Vertbatim`** (or using this link for the same result **`https://www.google.ca/?tbs=li:1`**) – ashleedawg Mar 28 '18 at 19:27
  • 1
    Have you looked at this: https://stackoverflow.com/questions/6872103/pin-lnk-file-to-windows-7-taskbar-using-c-sharp – Rufus L Mar 28 '18 at 19:27
  • @Rufus L Thank you I will try with that :D – Greenkiller Mar 28 '18 at 19:28

1 Answers1

3

That's be related to pinning an item to the taskbar in Windows 10.


More Information:

ashleedawg
  • 20,365
  • 9
  • 72
  • 105
  • 1
    Congrats on your 6K! Next stop, 10K! – Mathieu Guindon Mar 28 '18 at 19:48
  • @MathieuGuindon -Maybe a *couple* stops in between here and there but **thanks**! :-) That's what I get for answer a question for a language I've never touched in my life, about a VBA command I've never used... – ashleedawg Mar 28 '18 at 19:59