No of visitors who read this post: 199
Category: Windows XP
Type: Question
Author: Joshephadamm
No votes yet

Hi Experts,

I am having windows XP in my desktop and my visual basic editor gives error messages frequently. Does anyone know how to perform visual basic reboot computer to normal status. Thanks.

Regards,

Josephadamm

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#

Hi,

To reboot computer there are two methods in VB. I think you use .net code. I will give you both codes.

  • Shell command

Shutdown –r

  • .net command

           System.Diagnostics.Process.Start("shutdown", "/r") '

Changing letter “ r “ you can change the process to shutdown ,restart, or logoff.

Thanks.

# (Solution Accepted)

There are various commands to shut down the computer. Using the below code will shut down the computer after a 30 seconds delay:

System.Diagnostics.Process.Start("shutdown", "/r")

To avoid the delay you can use below command:

System.Diagnostics.Process.Start("ShutDown","/r /t 00")

See the below Thread for more options for restarting your computer using commands.