***********************************************************
echo rip fareast ime
rem 把Unicode编码的intl.inf文件转换为UTF8编码,这样普通的程序可以用类似处理英文的方法来处理
copy i386\intl.inf intl.inf
recode u2..u8 intl.inf
rem 在intl.inf文件中搜索带有[ime]这样的行
findstr /i ^^\[.*ime intl.inf |findstr /i /V \[FE_CONIME\] | findstr /i /V \[EA_IME_SHARED\] >tmp.imerfall.txt
rem 找出所有的和输入法相关的文件名字存入tmp.IMEfiles.txt
for /F "tokens=1,2,3* delims=[]" %%i in ('findstr /i /V LGReg tmp.imerfall.txt') do (
sed -n -e /^^\[%%i\]/,/^^\[.*\]/p intl.inf | sed -e /^^\[.*\]/d -e /^^$/d>>tmp.IMEfiles.txt
)
rem 找出所有和输入法相关的文件名字的注册表项存储为tmp.imeLGReg.txt,略过了英文的输入法的注册报条目
for /F "tokens=1,2,3* delims=[]" %%i in ('findstr /i LGReg tmp.imerfall.txt') do (
sed -n -e /^^\[%%i\]/,/^^\[.*\]/p intl.inf | sed -e /^^\[.*\]/d -e /^^$/d |findstr /V 00000804 |findstr /V 00000404>>tmp.imeLGReg.txt
)
rem 删除intl.inf中和ime相关的注册表项
fgrep -v -F -f tmp.imeLGReg.txt intl.inf>tmp.intl.inf
rem 删除可能存在的空格
if exist xxx.tmp.txt del /Q xxx.tmp.txt
for /F "eol=; tokens=1* delims=, " %%x in (tmp.imefiles.txt) do @echo %%x>>xxx.tmp.txt
move /Y xxx.tmp.txt tmp.imefiles.txt
rem 把所有要删除的文件都存到allfilefordel.txt中
type tmp.imefiles.txt>>allfilefordel.txt
rem 从intl.inf删除对这些输入法文件的引用
findstr /V /i /B /G:tmp.imefiles.txt tmp.intl.inf>intl.inf
rem 把intl.inf转换为unicode编码
recode u8..u2/21 intl.inf
rem 覆盖在i386目录的intl.inf文件
move /Y INTL.INF I386\intl.inf
rem 从txtsetup.sif删除对这些输入法文件的引用
findstr /V /i /B /G:tmp.imefiles.txt i386\txtsetup.sif>tmp.txtsetup.sif
move /Y tmp.txtsetup.sif i386\txtsetup.sif
rem 从dosnet.inf删除对这些输入法文件的引用
findstr /V /i /B /G:tmp.imefiles.txt i386\dosnet.inf>tmp.dosnet.inf
move /Y tmp.dosnet.inf i386\dosnet.inf
rem 复制HIVESYS.INF文件
copy I386\HIVESYS.INF HIVESYS.INF
rem 把HIVESYS.INF转换为utf8编码
recode u2..u8 HIVESYS.inf
rem 需要删除的注册表项
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0010804">tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0020804">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0030804">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0050804">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E00E0804">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409">>tmp.imereg.lst
rem 从HIVESYS.INF中删除上面的注册表项
findstr /i /v /G:tmp.imereg.lst HIVESYS.INF >tmp.hivesys.inf
move /Y tmp.hivesys.inf hivesys.inf
rem 把hivesys.inf变换为unicode编码
recode u8..u2/21 hivesys.inf
rem 覆盖i386目录的 hivesys.inf
move /Y HIVESYS.INF I386\HIVESYS.INF
rem 删除临时文件
del tmp.*
***********************************************************
findstr /V /i /B /G:tmp.imefiles.txt i386\dosnet.inf>tmp.dosnet.inf这句从dosnet.inf删除对这些输入法文件的引用不好用啊!tmp.imefiles.txt里是单纯的文件名,dosnet.inf里是文件名前加了个d1,,这样也不能比较啊,不好用!而且我发现dosnet.inf也有问题,可能是编码的问题,我用findstr /v /i /b /G:dosnet.inf dosnet.inf居然出来结果了,是同一个文件啊,一样一样的,怎么会出来结果呢?用recode u2..u8 dosnet.inf也不行,还是一样出现结果!请问这是怎么回事?
echo rip fareast ime
rem 把Unicode编码的intl.inf文件转换为UTF8编码,这样普通的程序可以用类似处理英文的方法来处理
copy i386\intl.inf intl.inf
recode u2..u8 intl.inf
rem 在intl.inf文件中搜索带有[ime]这样的行
findstr /i ^^\[.*ime intl.inf |findstr /i /V \[FE_CONIME\] | findstr /i /V \[EA_IME_SHARED\] >tmp.imerfall.txt
rem 找出所有的和输入法相关的文件名字存入tmp.IMEfiles.txt
for /F "tokens=1,2,3* delims=[]" %%i in ('findstr /i /V LGReg tmp.imerfall.txt') do (
sed -n -e /^^\[%%i\]/,/^^\[.*\]/p intl.inf | sed -e /^^\[.*\]/d -e /^^$/d>>tmp.IMEfiles.txt
)
rem 找出所有和输入法相关的文件名字的注册表项存储为tmp.imeLGReg.txt,略过了英文的输入法的注册报条目
for /F "tokens=1,2,3* delims=[]" %%i in ('findstr /i LGReg tmp.imerfall.txt') do (
sed -n -e /^^\[%%i\]/,/^^\[.*\]/p intl.inf | sed -e /^^\[.*\]/d -e /^^$/d |findstr /V 00000804 |findstr /V 00000404>>tmp.imeLGReg.txt
)
rem 删除intl.inf中和ime相关的注册表项
fgrep -v -F -f tmp.imeLGReg.txt intl.inf>tmp.intl.inf
rem 删除可能存在的空格
if exist xxx.tmp.txt del /Q xxx.tmp.txt
for /F "eol=; tokens=1* delims=, " %%x in (tmp.imefiles.txt) do @echo %%x>>xxx.tmp.txt
move /Y xxx.tmp.txt tmp.imefiles.txt
rem 把所有要删除的文件都存到allfilefordel.txt中
type tmp.imefiles.txt>>allfilefordel.txt
rem 从intl.inf删除对这些输入法文件的引用
findstr /V /i /B /G:tmp.imefiles.txt tmp.intl.inf>intl.inf
rem 把intl.inf转换为unicode编码
recode u8..u2/21 intl.inf
rem 覆盖在i386目录的intl.inf文件
move /Y INTL.INF I386\intl.inf
rem 从txtsetup.sif删除对这些输入法文件的引用
findstr /V /i /B /G:tmp.imefiles.txt i386\txtsetup.sif>tmp.txtsetup.sif
move /Y tmp.txtsetup.sif i386\txtsetup.sif
rem 从dosnet.inf删除对这些输入法文件的引用
findstr /V /i /B /G:tmp.imefiles.txt i386\dosnet.inf>tmp.dosnet.inf
move /Y tmp.dosnet.inf i386\dosnet.inf
rem 复制HIVESYS.INF文件
copy I386\HIVESYS.INF HIVESYS.INF
rem 把HIVESYS.INF转换为utf8编码
recode u2..u8 HIVESYS.inf
rem 需要删除的注册表项
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0010804">tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0020804">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0030804">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0050804">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E00E0804">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00010409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00020409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00030409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409">>tmp.imereg.lst
echo HKLM,"SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00040409">>tmp.imereg.lst
rem 从HIVESYS.INF中删除上面的注册表项
findstr /i /v /G:tmp.imereg.lst HIVESYS.INF >tmp.hivesys.inf
move /Y tmp.hivesys.inf hivesys.inf
rem 把hivesys.inf变换为unicode编码
recode u8..u2/21 hivesys.inf
rem 覆盖i386目录的 hivesys.inf
move /Y HIVESYS.INF I386\HIVESYS.INF
rem 删除临时文件
del tmp.*
***********************************************************
findstr /V /i /B /G:tmp.imefiles.txt i386\dosnet.inf>tmp.dosnet.inf这句从dosnet.inf删除对这些输入法文件的引用不好用啊!tmp.imefiles.txt里是单纯的文件名,dosnet.inf里是文件名前加了个d1,,这样也不能比较啊,不好用!而且我发现dosnet.inf也有问题,可能是编码的问题,我用findstr /v /i /b /G:dosnet.inf dosnet.inf居然出来结果了,是同一个文件啊,一样一样的,怎么会出来结果呢?用recode u2..u8 dosnet.inf也不行,还是一样出现结果!请问这是怎么回事?
附件
