Search Tools Links Login

VB code with Window Network API

Posted: 2002-06-01
By: ArchiveBot
Viewed: 60

Filed Under:

Visual Basic 6

No attachments for this post

With this code your can Shutdown any Workstation connected on LAN (Local Area Network) od Windows NT/2000.
This code is very usefull for LAN applications. It will give an good idea to communicate with other worstations.

Original Author: Abid Khurshid Butt


Just Workstation Name to Shutdown


User must know something about Windows API and some knowledge of Network.


Required Workstation will Shutdown

Side Effects

There no side effects for this code.

API Declarations

Private Declare Function InitiateSystemShutdown Lib "advapi32.dll" Alias "InitiateSystemShutdownA" (ByVal lpMachineName As String, ByVal lpMessage As String, ByVal dwTimeout As Long, ByVal bForceAppsClosed As Long, ByVal bRebootAfterShutdown As Long) As Long


Private Sub Command1_Click()
  Dim a
  a = InitiateSystemShutdown(Trim(Text1.Text), "Hello", 0, 0, 1)
  MsgBox "Shutdown Completed"
End Sub

Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.