CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: registry change

  1. #1
    Join Date
    Feb 2012
    Posts
    2

    registry change

    i am trying to simply change a registry value for a linksys wlan adapter using some vb script. The script is below: when i run this from cmd line with cscript i dont see the change in the registry.

    const HKEY_LOCAL_MACHINE = &H80000002
    strComputer = "."
    Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&_
    strComputer & "\root\default:StdRegProv")
    dim return
    return = objReg.SetStringValue (HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0033", "MPC","1")

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: registry change

    What OS are you running...

    Some OS's have locked parts of the registry, so that scripts like this cant cause havoc on the system..

    AFAIK. not even Admin privileges allows the Reg to be written...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Feb 2012
    Posts
    2

    Re: registry change

    thanks for the reply. this is a windows xp sp3 pc. if it helps: i am able to go into the regedit and change this value.

    thanks!!

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: registry change

    Try to export it, then CHANGE it. You can IMPORT it then.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: registry change

    Quote Originally Posted by avlbryan View Post
    thanks for the reply. this is a windows xp sp3 pc. if it helps: i am able to go into the regedit and change this value.

    thanks!!
    Regedit has 100% access to the reg.. It's other app's that are locked out from writing to .. LocalMachine, CurrentConfig & Users reg.. And parts of the CurrentUser reg is also locked..

    Now the next question is Why do you want to change this reg entry, there may be another way to get to what you want....
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured