How do I exit a WPF application programmatically?

How is one supposed to exit an application such as when the user clicks on the Exit menu item from the File menu? I have tried: this.Dispose(); this.Exit(); Application.ShutDown(); Application.Exit(); Application.Dispose(); Among many others. Nothing works. 18 s 18 To exit your application you can call System.Windows.Application.Current.Shutdown(); As described in the documentation to the Application.Shutdown … Read more

How do I shutdown, restart, or log off Windows via a bat file?

I’ve been using Remote Desktop Connection to get into a workstation. But in this environment, I cannot use the power options in Start Menu. I need an alternative way to shutdown or restart. How do I control my computer’s power state through the command line? 10 s 10 The most common ways to use the … Read more