如下的.bat文件实现JRE1.5到JRE1.3的切换
@echo off
SETLOCAL
VER | find "2000" > nul
IF not errorlevel 1 GOTO Win2000
VER | find "XP" > nul
IF not errorlevel 1 GOTO WinXP
GOTO unknown_os
:Win2000
REG UPDATE HKEY_CLASSES_ROOT\CLSID\{8AD9C840-044E-11D1-B3E9-00805F499D93}\="Java Plug-in 1.3.1_06"
REG UPDATE HKEY_CLASSES_ROOT\CLSID\{8AD9C840-044E-11D1-B3E9-00805F499D93}\InprocServer32\="C:\\Program Files\\JavaSoft\\JRE\\1.3.1_06\\bin\\NPJava131_06.dll"
REG UPDATE HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}\InprocServer32\="C:\\Program Files\\JavaSoft\\JRE\\1.3.1_06\\bin\\NPJava131_06.dll"
goto end
:WinXP
REG ADD HKEY_CLASSES_ROOT\CLSID\{8AD9C840-044E-11D1-B3E9-00805F499D93} /ve /d "Java Plug-in 1.3.1_06" /f
REG ADD HKEY_CLASSES_ROOT\CLSID\{8AD9C840-044E-11D1-B3E9-00805F499D93}\InprocServer32 /ve /d "C:\\Program Files\\JavaSoft\\JRE\\1.3.1_06\\bin\\NPJava131_06.dll" /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}\InprocServer32 /ve /d "C:\\Program Files\\JavaSoft\\JRE\\1.3.1_06\\bin\\NPJava131_06.dll" /f
goto end
:unknown_os
:end
用如下的.bat实现JRE1.3到JRE1.5的切换
@echo off
SETLOCAL
VER | find "2000" > nul
IF not errorlevel 1 GOTO Win2000
VER | find "XP" > nul
IF not errorlevel 1 GOTO WinXP
GOTO unknown_os
:Win2000
REG UPDATE HKEY_CLASSES_ROOT\CLSID\{8AD9C840-044E-11D1-B3E9-00805F499D93}\="Java Plug-in 1.5.0_09"
REG UPDATE HKEY_CLASSES_ROOT\CLSID\{8AD9C840-044E-11D1-B3E9-00805F499D93}\InprocServer32\="C:\\Program Files\\JavaSoft\\JRE\\1.5.0_09\\bin\\ssv.dll"
REG UPDATE HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}\InprocServer32\="C:\\Program Files\\JavaSoft\\JRE\\1.5.0_09\\bin\\ssv.dll"
goto end
:WinXP
REG ADD HKEY_CLASSES_ROOT\CLSID\{8AD9C840-044E-11D1-B3E9-00805F499D93} /ve /d "Java Plug-in 1.5.0_09" /f
REG ADD HKEY_CLASSES_ROOT\CLSID\{8AD9C840-044E-11D1-B3E9-00805F499D93}\InprocServer32 /ve /d "C:\\Program Files\\JavaSoft\\JRE\\1.5.0_09\\bin\\ssv.dll" /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{761497BB-D6F0-462C-B6EB-D4DAF1D92D43}\InprocServer32 /ve /d "C:\\Program Files\\JavaSoft\\JRE\\1.5.0_09\\bin\\ssv.dll" /f
goto end
:unknown_os
:end
posted on 2008-11-17 11:43
金牛 阅读(980)
评论(0) 编辑 收藏 所属分类:
Java