0

How can I run command-Line from Windows RT Application (C#.net) for example:

netstat
ipconfig /renew

...etc

I don't want to use API for network, library for graphics- just running commands and read result.

4
  • 4
    Those are not "DOS", you likely mean "command line". Commented Sep 10, 2014 at 4:41
  • Do you mean a Windows Store application or a desktop application? Commented Sep 10, 2014 at 4:54
  • 1
    If you really want to run DOS commands, buy yourself a vintage PC from the 1980's. (I get so tired of people calling command-line programs DOS commands!) Commented Sep 10, 2014 at 5:04
  • yes i want to run command line. @RenniePet -> read "Politeness" written by Richard J. Watts Commented Sep 11, 2014 at 10:32

1 Answer 1

3

To run the commands you would need to use the Process class.

However, the Process class is not available to WINRT applications so you can not do what you want to do as a WINRT application, you would need to build your program as a desktop application to be able to do it.

If you don't want to or can't re-write your program as a desktop application I would recommend learning how to call the proper WINRT APIs for the network information.

Sign up to request clarification or add additional context in comments.

3 Comments

The WinRT API is supposed to be available for desktop apps as well as for "modern" aka Windows Store apps. Is there no way to launch a process via the WinRT API for a desktop app? Maybe via COM to the shell?
@HarryJohnston The RT API is is a limited subset of the full API. So desktop should be able to call all calls that Store and Phone apps can, plus extra. You might be able to hack via COM, but I doubt any way you do find would be considered "supported" and could vanish at any windows update without warning. The intent of "Modern" and Windows phone apps is to be totally sandboxed from the system, so you can't do stuff like calling other external processes because that would be reaching out of your sandbox.
From what I've read, e.g., here, the full WinRT API (as opposed to just the part available to Store and Phone apps) is supposed to include essentially all Win32 functionality. This seems an odd omission.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.