none
Shutting down the computer programmatically RRS feed

  • Question

  • I am fairly new to visual basic. I would like to write a program which will shut down the computer when it is done. How do I do that?
    • Edited by franqlyn Monday, September 4, 2017 1:01 AM
    Monday, September 4, 2017 1:00 AM

Answers

All replies

  • See the following MSDN code sample

    https://code.msdn.microsoft.com/windowsapps/How-to-shut-down-the-6f4addc7


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by franqlyn Monday, September 4, 2017 1:43 PM
    Monday, September 4, 2017 2:34 AM
    Moderator
  • Thank you, but I do not understand anything in your response.
    Monday, September 4, 2017 1:43 PM
  • I have found it at technet.microsoft.com. the command is :::  Shell("shutdown -s")

    Thursday, September 7, 2017 3:52 PM
  • I have found it at technet.microsoft.com. the command is :::  Shell("shutdown -s")

    Yep, that is also in the link I shared too but instead using a better method than Shell, Process.Start.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, September 7, 2017 4:06 PM
    Moderator