I'm building my first Win 10 app (in Visual C#) and I had a quick question. (I'm a Java/ Android guy)
I want to be able to run cmd line programs from my app. This will be a desktop app and I need to have the ability to shutdown, restart, lock, and abort a restart from the app. I know I can use the 'Shutdown' cmd, but how can I launch it?
Thank you!
Any program you can run from the command line is a program you can run without the command line. For example,
shutdown
; try opening the Run box (Win+R) and typing:You'll see that Windows warns the system will be rebooting in 60 seconds (of course,
shutdown /a
will abort the shutdown). So, you should just be able to useProcess.Start
to run the command. No need to launch a full command line.