Announcement

Collapse
No announcement yet.

Adding Key and Data to remote computer registry

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding Key and Data to remote computer registry

    I am working on a custom tool that will allow me to add a missing registry key and it's associated data to a remote computer's registry through Hyena.

    This what I have so far

    cmd.exe /x /c REG ADD "\\%E%\HKLM\SYSTEM\CurrentControlSet\Control\Sessi on Manager\Environment" /v Path /t REG_EXPAND_SZ /d %%SystemRoot%%\System32;%%SystemRoot%%;%%SystemRoo t%%\System32\Wbem & Pause

    When I run this against a remote system I get this error in the Command Prompt window

    Error: Too many command-line parameters
    Press any key to continue . . .

    Now...If I change the command to look like this...

    cmd.exe /x /c REG ADD "\\%E%\HKLM\SYSTEM\CurrentControlSet\Control\Sessi on Manager\Environment /v Path /t REG_EXPAND_SZ /d %%SystemRoot%%\System32;%%SystemRoot%%;%%SystemRoo t%%\System32\Wbem" & Pause

    It runs successfully but it creates a new Key named

    Environment /v Path /t REG_EXPAND_SZ....etc

    I know I'm close to solving this I just don't know where the "" go.

    Any help would be appreciated

  • #2
    Re: Adding Key and Data to remote computer registry

    I did a similar thing using psexec and "reg import" to bring in some registry entries. The reg key is stored on a central server.

    My tools command looks like this:

    psexec \\%E% -u %P1:UserID% -p %P2:Password/PWD% reg import \\server\regkeys\data.reg

    Hope this helps...

    Comment

    Working...
    X