+ Reply to Thread
Results 1 to 2 of 2

Thread: Update registry each 5 minutes

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    31

    Update registry each 5 minutes

    I`d like to make a script that will update registry each 5 minutes , i was wondering if you
    could give me an example ?

  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    41
    Try that :
    Code:
    Do While 1
    On Error Resume Next
    HKEY_CURRENT_USER = &H80000001
    strComputer = "."
    Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
    strKeyPath = "Control Panel\Desktop"
    ValueName = "ScreenSaveActive"
        objReg.GetStringValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue
        objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
    If IsNull(strValue) Then
        Wscript.Echo "The value is either Null or could not be found in the registry."
    Else
        Wscript.Echo "Value: ", strValue
        strValue = "1"
        objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue
        Wscript.Echo "Value after change ", strValue
    End If
    WScript.Sleep(120 * 5000)
    Loop

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts