by Krishna Murthy K N (1 Submission)
Category: Windows System Services
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 5th September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Shut down or Restart the computer with one line of code
Private Sub Command1_Click()
'Shutdown the computer
Shell ("rundll.exe user.exe,exitwindows")
End Sub
Private Sub Command2_Click()
'Restart the computer
Shell ("rundll.exe user.exe,exitwindowsexec")
End Sub