none
SetDwordValue not working in vbs RRS feed

  • Question

  • Const HKEY_CLASSES_ROOT= &H80000000
    Const HKEY_CURRENT_USER= &H80000001
    Const HKEY_LOCAL_MACHINE= &H80000002
    Const HKEY_USERS= &H80000003
    Set StdOut = WScript.StdOut
    Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
    
    strKeyPath = "SYSTEM\CurrentControlSet\Hardware Profiles\UnitedVideo\CONTROL\VIDEO\{D218E173-A430-11E8-80D8-005056C00008}\0001"
    strValueName = "venkat"
    oReg.SetDWordValue   HKEY_LOCAL_MACHINE, strKeyPath, strValueName, 800
    oReg.GetDWordValue   HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dval
    WScript.Echo "SYSTEM\CurrentControlSet\Control\"  & " = " &  dval

    Am running in windows 10. 

    SetDWordValue of vbs is not working

    GetDwordValue working fine and am getting the data.

    Tried all the possibilities. Even the code from msdn is not working. I want to change my registry key using vbs

    please help me.


    Venkatesan Prabu .J www.kaashivinfotech.com http://venkattechnicalblog.blogspot.com/

    Tuesday, July 30, 2019 11:49 PM

All replies

  • Are you sure that the registry path you are attempting to access exists?

    On my local host, my path looks different:


    -Eriq VanBibber, CTO, Priasoft Inc.

    Wednesday, July 31, 2019 12:03 AM