|
@echo off
setlocal enabledelayedexpansion
for /f "tokens=1,2,*" %%I in ('reg query "HKEY_CLASSES_ROOT\*\shell" /s') do (
set value=%%I
set type=%%J
set data=%%K
if /i "!value:~0,5!"=="HKEY_" (
set key=!value!
) else (
if not "!data!"=="" (
set newdata=!data:E:\Software=D:\Software!
if not "!newdata!"=="!data!" (
::将数据中的"替换为\"以免reg add时被胡乱匹配
set newdata=!newdata:"=\"!
if "!value!"=="(默认)" (
reg add "!key!" /ve /t !type! /d "!newdata!" /f
) else (
reg add "!key!" /v "!value!" /t !type! /d "!newdata!" /f
)
)
)
)
) |
|