none
Help manipulating some regkeys. RRS feed

  • Question

  • Hi I am hoping someone can help me.

     

    I need to put the following regkey below in a regadd command and also I need to increment the clientid.

     

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Sanako\Shared Components\NetCommPlatform\Client]
    "ClientId"=dword:00000020 <--- this is HEX and needs to be incremented
    "ServerAddress"="5E17-CONTROL"

     

     

    For example: If the station number is 5E17-01 I need to change the client ClientId"=dword: to the hex value of 01 omitting the 5E17-

    Thursday, August 14, 2014 10:56 PM

Answers

  • great,

    one last thing, I recommend you try to use Powershell instead of batch even for the simplest tasks for 2 main reasons, 1) it's much more powerful - provides much more capabilities, and 2) it's increasingly unavoidable (Desired State Configuration for example is PS based and it's a major shift if IT)


    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

    Friday, August 15, 2014 8:48 AM

All replies

  • What have you tries so far?

    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Thursday, August 14, 2014 11:17 PM
    Moderator
  • We cannot tell what you are asking because there is not enough information to do what you are asking.

    Start here:

    REG ADD /?

    When you have a script that does close to what you think you want then post back with a specific question.

    We do not write scripts on request.


    ¯\_(ツ)_/¯

    Friday, August 15, 2014 12:08 AM
  • Is that what you're looking for:

    It's not clear where ServerAddress comes into play here, if at all..

    $Key = "HKLM:\SOFTWARE\Wow6432Node\Sanako\Shared Components\NetCommPlatform\Client"
    #
    $ClientID = Get-ItemProperty -Path $key -Name "ClientID"
    $ServerAddress = Get-ItemProperty -Path $key -Name "ServerAddress"
    #
    # To increment ClientID:
    Set-ItemProperty -Path $key -Name "ClientID" -Value ($ClientID.ClientID+1)


    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

    • Proposed as answer by Sam Boutros Friday, August 15, 2014 8:44 AM
    Friday, August 15, 2014 1:13 AM
  • Thanks Sam you've given me a good base to play with. Basically If the station name is 5E17-22, the client ID has to be 22, if the station name is 5E13-12, then the clientid has to be 12.The server addresses are static and never change from 5E13-CONTROL AND 5E17-CONTROL

    This is the batch file.

    @echo off
    set room=%COMPUTERNAME:~0,4%
    set stn=%COMPUTERNAME:~-2%

    reg.exe ADD "HKLM\SOFTWARE\Wow6432Node\Sanako\Shared Components\NetCommPlatform\Client" /v ClientId /t REG_DWORD /d %stn% /f
    reg.exe ADD "HKLM\SOFTWARE\Wow6432Node\Sanako\Shared Components\NetCommPlatform\Client" /v ServerAddress /t REG_SZ /d "%room%-CONTROL" /f
    exit


    echo name=%computerName%
    echo room=%room%
    echo stn=%stn%
    pause


    Friday, August 15, 2014 3:38 AM
  • great,

    one last thing, I recommend you try to use Powershell instead of batch even for the simplest tasks for 2 main reasons, 1) it's much more powerful - provides much more capabilities, and 2) it's increasingly unavoidable (Desired State Configuration for example is PS based and it's a major shift if IT)


    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

    Friday, August 15, 2014 8:48 AM