Bu script sayesinde bilgisayar üzerinde yeni bir local user account yaratılmış, bu local user account’a bir password atanmış ve account ilgili gruba member edilmiş olur. Bununla birlikte account için “password never expires” ayarıda enable olur yani password süresiz olarak geçerlidir.

Script içerisinde strAccount, strPswd ve son bölümdeki Set objGroup satırında grup bilgisini düzenlemeyi unutmayın.

' specify account to create
strAccount = "Ozgur"
strPswd = "123456"

' get local computer name
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName

' check if local account already exists
intExists = 0
Set colAccounts = GetObject("WinNT://" & strComputer & "")
colAccounts.Filter = Array("user")
For Each objUser In colAccounts
    If objUser.Name = strAccount Then
     intExists = 1
  End If
Next

If intExists = 0 Then
   ' create local user
   Set colAccounts = GetObject("WinNT://" & strComputer & "")
   Set objUser = colAccounts.Create("user", strAccount)

   ' set pswd
   objUser.SetPassword strPswd
   objUser.SetInfo

   ' set pswd never expires
   Set objUser = GetObject("WinNT://" & strComputer & "/" & strAccount & ",User")
   objUserFlags = objUser.Get("UserFlags")
   objPasswordExpirationFlag = objUserFlags Or ADS_UF_DONT_EXPIRE_PASSWD
   objUser.Put "userFlags", objPasswordExpirationFlag
   objUser.SetInfo

   ' add to local admins group
   Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
   Set objUser = GetObject("WinNT://" & strComputer & "/" & strAccount & ",user")
   objGroup.Add(objUser.ADsPath)
End If

Vb scriptlerin nimetlerinden faydalanmaya devam ediyoruz. Bu seferki scriptimiz belirlediğiniz süre içerisinde otomatik alt+tab tuş kombinasyonu yapıyor.Ne işimize yarayacak diyebilirsiniz.Hemen kısa bir örnek vereyim; alt+tab tuş kombinasyonunu kısayol olarak kullanan bir program kullandığınızı ve bu programın her 5 dakikada bir refresh edilmesi gerektiğini varsayalım.İşte böyle bir durumda bu script çok işinize yarayabilir.

Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
Do
objShell.SendKeys "%+{TAB}"
Wscript.Sleep 180000
Loop

Dikkat : 180000 = 3 dk

teknolojikadam.com'da şu an 12 ziyaretçi geziniyor. Toplam 69 yazı, 130 yorum var