locked
How to run a batch file or execute a command from windows store app

    Question

  • Hi,

    I want to run/execute a command from my windows store app. Is there any way by which we can do it?

    regards,

    Subhankar

    Wednesday, June 25, 2014 7:51 AM

Answers

  • You can do this by writing a brokered WinRT component as I described in the link above. Please re-read that link carefully and research the topic, as it is the correct answer.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, June 27, 2014 11:58 AM
    Moderator

All replies

  • In a Store-submitted app, no.  For an LOB app, yes, you can do this using a brokered component:

    http://blogs.msdn.com/b/wsdevsol/archive/2014/04/14/cheat-sheet-for-using-brokered-windows-runtime-components-for-side-loaded-windows-store-apps.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, June 25, 2014 12:40 PM
    Moderator
  • I am sorry but I couldn't understand my usecase from this blog.

    Is it possible to give some code snippet for my usecase where I want to execure a command on a button click ?

    Thursday, June 26, 2014 5:53 AM
  • You didn't answer the basic question:  are you writing a Store-submitted app, or an LOB app?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, June 26, 2014 12:03 PM
    Moderator
  • This app need not be submitted to store. All I want is to run another exe installed in PC either directly from Windows app or running a batch command.
    Friday, June 27, 2014 2:51 AM
  • You can do this by writing a brokered WinRT component as I described in the link above. Please re-read that link carefully and research the topic, as it is the correct answer.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, June 27, 2014 11:58 AM
    Moderator