reg.exe - Missing reg UPDATE in Version 3

Discussion in 'Windows Server' started by Alex, Feb 15, 2005.

  1. Alex

    Alex Guest

    in older Version from reg.exe exist the command "reg UPDATE"
    How can i implement this in reg.exe Version 3.0 from XP-SP2 or Windows
    Server 2003?
    With reg ADD i must always give a type of the the registry-Value
    How can i update an existing Registry-Value like reg UPDATE?

    Thanks you!
    Regards Alex
     
    Alex, Feb 15, 2005
    #1
    1. Advertisements

  2. I have scripted REG_Type.bat return the data type to your script, so you can use it in the REG ADD command.

    See tip 9060 in the 'Tips & Tricks' at http://www.jsiinc.com
    < http://www.jsiinc.com/SUBS/tip9000/rh9060.htm >

    Sample usage:
    If you want to set ShutdownWithoutLogon to 1 at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
    but you don't know the data type:

    call reg_type "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" ShutdownWithoutLogon type
    if "%type%" EQU "NONE" goto error
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V ShutdownWithoutLogon /T %type% /F /D 1


    Jerold Schulman
    Windows Server MVP
    JSI, Inc.
    http://www.jsiinc.com
     
    Jerold Schulman, Feb 15, 2005
    #2
    1. Advertisements

  3. Hi Alex,

    I blieve "reg update" parameter has been removed from the version 3 for
    security reasons since it may cause serious problem to update the registry
    if we don't know the registry entry type.

    As Jerry has said, you may consider using a script to query the registry
    entry and update it.

    If you is updating a set of known values just pre-determine the data type
    and add it to the scripts, or use a script like below to determine the data
    type on the fly

    for /f "tokens=2 skip=2" %i in ('reg query "HKLM\SOFTWARE\Microsoft\Command
    Processor" /v AutoRun') do ('reg add "HKLM\SOFTWARE\Microsoft\Command
    Processor" /v AutoRun /t %i /d "My New AutoRun value"

    Note:
    Use 2 % signs on the i variable if using in a batch file.

    Any update, let us get in touch!

    Best regards,

    Rebecca Chen

    MCSE2000 MCDBA CCNA


    Microsoft Online Partner Support
    Get Secure! - www.microsoft.com/security

    =====================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    =====================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Rebecca Chen [MSFT], Feb 25, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.