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
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
Comment