VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Shut down or Restart the computer with one line of code

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

Rate 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


Download this snippet    Add to My Saved Code

Shut down or Restart the computer with one line of code Comments

No comments have been posted about Shut down or Restart the computer with one line of code. Why not be the first to post a comment about Shut down or Restart the computer with one line of code.

Post your comment

Subject:
Message:
0/1000 characters