Kod:
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer AsString, nSize As Long) As Long Private Sub Command1_Click() If "" & Combo1.Text & "" = "" Then MsgBox "Kullanıcı Seciniz", vbCritical, "Kullanıcı Sil" GoTo 10 End If strUser = Combo1.Text Set objComputer = GetObject("WinNT://" & Frame1 & "") objComputer.Delete "user", strUser Combo1.RemoveItem Combo1.ListIndex Combo1.ListIndex = 0 MsgBox "Kullanıcı Başarıyla Silindi", vbCritical, "Kullanıcı Sil" 10 End Sub Private Sub Form_Load() Dim NameOfPC As String NameOfPC = GetComputer Frame1 = NameOfPC Set objNetwork = CreateObject("Wscript.Network") Set colAccounts = GetObject("WinNT://" & objNetwork.ComputerName & "") colAccounts.Filter = Array("user") For Each objUser In colAccounts Combo1.AddItem (objUser.Name) Next End Sub Function GetComputer() As String Dim X As Long Dim PCName As String * 255 PCName = Space(255) X = GetComputerName(PCName, 255&) GetComputer = Left$(PCName, InStr(PCName, vbNullChar) - 1) End Function
__________________
Windows Kullanıcı sil
Programlama0 Mesaj
●38 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama
- Windows Kullanıcı sil