- @echo off
- for /f "tokens=1-2 delims=:" %%a in ('reg query "HKEY_CURRENT_USER\123\456" /v key1') do (
- set "valueLeft=%%a"
- set "valueRight=%%b"
- )
- set "value=%valueLeft:~-1%:%valueRight%"
- reg add "HKEY_CURRENT_USER\123\456" /v key2 /t reg_sz /d "%value%" /f
复制代码
|