Results 1 to 4 of 4

Thread: Import Windows Registry

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2012
    Posts
    11

    Import Windows Registry

    I would like to disable Java update on several PC.

    Below is the windows registry command but I would like to have it in a vbscript.



    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy]
    "EnableJavaUpdate"=dword:00000000

    Thanks

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Import Windows Registry

    Save that key to a file with a .reg extension, then, from each machine, you can run
    Code:
    Shell "regedit.exe NameOfFileYouCreated.reg /s", vbNormalFocus

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2012
    Posts
    11

    Re: Import Windows Registry

    Just curious to know is there a way to actually write the command in VB ?

    Reason I`m asking is this will travel in several different subnet with another vbs file and I`m afraid if I start using several file one of them may get lost.

    If I was able to have it in a vbscript It will be easier to add it to one of the script we have.

    THanks

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2012
    Posts
    11

    Re: Import Windows Registry

    Found what is was looking for ... Thanks

    const HKEY_LOCAL_MACHINE = &H80000002
    strComputer = "."
    Set StdOut = WScript.StdOut

    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
    strComputer & "\root\default:StdRegProv")

    strKeyPath = "SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy"
    strValueName = "String Value Name"
    strValue = "string value"
    oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

    strValueName = "EnableJavaUpdate"
    dwValue = 00000000
    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

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