Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Well I've found only this way: web.archive.org/web/20080205152949/http://… to execute above code in C#. I hope I'm missing something, because that way isn't really convenient...
    – Paya
    Commented Apr 12, 2010 at 16:18
  • You can call COM code in C# (Or put my code in a .js file and execute it with wscript.exe)
    – Anders
    Commented Apr 12, 2010 at 16:21
  • And to what should I cast object returned from System.Runtime.InteropServices.Marshal.GetActiveObject("Shell.Application");? I just wasn't able to find any suitable interface (I really don't know much about COM).
    – Paya
    Commented Apr 12, 2010 at 16:32
  • I just can't get it running. I've tried this code: pastebin.com/GFhPCWwX but it just thrown an exception on GetActiveObject (MK_E_UNAVAILABLE). I've tried running the program with admin rights, same exception... What am I missing?
    – Paya
    Commented Apr 15, 2010 at 13:15