Search code examples
c#windowsuniversalcortana

C# - System.Diagnostics.Process does not exist


Literally just picked this up from scratch tonight, so bear with me.

I'm having a go at coding some Cortana commands, such as to shut down my computer (for example). I'm following this tutorial here through a Stack Overflow question I found here.

Everything works great - cortana picks up my command and runs the command as the tutorial states (display a pop up when the command is recognised).

However when I come to actually coding the shutdown command, System.Diagnostics.Process, it is not recognised. I have included the relevant using statements as well.

I've searched around and found (I think) that Process can no longer be used? Is this the case?

On another note, is there another way I can shutdown my machine from a C# Universal Windows App?:)


Solution

  • I don't believe there is anyway to shutdown the OS from a UWP app. They have removed any APIs from UWP which would have allowed this.