批量导出指定注册表内容
复制,保存为bat文件
cmd 先进入到bat目录,执行bat后,将会按关键字搜索,然后在同目录下生成一个.reg文件。到需要的电脑上导入即可
@set @n=0;/* & echo off
set "keyword=EasyMail."
set "regfile=Result.reg"
cd.>"%regfile%"
(for %%a in (HKLM HKCU HKCR HKU HKCC) do (
for /f "delims=" %%b in ('reg query "%%a" /s /f "%keyword%" /k')do (
reg export "%%b" $
copy /b "%regfile%" + $ "%regfile%"
del $
)
)) 2>nul
for %%a in ("%regfile%") do (
if "%%~za" NEQ "0" (
cscript -nologo -e:jscript "%~0" "%regfile%"
start NotePad "%regfile%"
) else del "%regfile%"
)
pause & exit/b & rem */
str = "Windows Registry Editor Version 5.00\r\n";
regfile = WScript.Arguments(0);
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.OpenTextFile(regfile, 1, false, -1);
ar = f.Readall().split(str);
f.Close();
re = /^\[[\s\S]*?(?=^\[)/m;
ar[0] = str + "\r\n";
for (i=1; i<ar.length; i++) {
ar[i] = re.exec(ar[i] + "\r\n[")[0];
}
fso.OpenTextFile(regfile, 2, true, -1).Write(ar.join(""))