Results 1 to 4 of 4

Thread: HELP Shutting down windows...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Posts
    73

    HELP Shutting down windows...

    I would like to find a way to shut down windows(computer) without calling an API or using the command prompt shutdown. I want to do it in .NET... perhaps with WMI? Any help would be greatly appreciated!

    -Mat

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: HELP Shutting down windows...

    VB Code:
    1. System.Diagnostics.Process.Start("shutdown", "-t 0")

    Only way I can think to do it (I didn't test that code, it may need adjusting but you get the idea).
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3
    Addicted Member
    Join Date
    Sep 2004
    Posts
    133

    Re: HELP Shutting down windows...

    Or, if you can even do it just at a command promp (or in a batch file) as

    shutdown -t 0

    if you need to make sure you force running application to close you can use

    sutdown -f -t 0

    or if you want to do a reboot you can use

    shutdown -f -r -t 0

    just go to the command prompt and enter

    shutdown /?

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,484

    Re: HELP Shutting down windows...

    Can I ask why?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width