@echo off
if exist %ComSpec% goto nt else goto 9x
:9x
set etc=%windir%\
set hosts=%windir%\hosts
goto menu
:nt
if exist %windir%\system32\cmd.exe goto winnt32
if exist %windir%\system64\cmd.exe goto winnt64
:winnt32
set etc=%windir%\system32\drivers\etc
set hosts=%windir%\system32\drivers\etc\hosts
goto menu
:winnt64
set etc=%windir%\system64\drivers\etc
set hosts=%windir%\system64\drivers\etc\hosts
goto menu
:menu
attrib -s -a -r %hosts%
find "202.104.120.79	kdtsplatform.kingdee.com" %hosts% > nul
if %errorlevel% == 1 (
  @echo.>>%hosts% 
  @echo 202.104.120.79	kdtsplatform.kingdee.com >>%hosts%
  @echo 127.0.0.1       kdtsplatform.kingdee.com >>%hosts%
  @echo 127.0.0.1	patch.cmcloud.cn >>%hosts%
  @echo 127.0.0.1	api.cmcloud.cn >>%hosts%
  @echo 127.0.0.1	cmcloud.cn >>%hosts%
  @echo 127.0.0.1	service.kingdee.com >>%hosts%
  @echo 127.0.0.1       sso.cmcloud.cn >>%hosts%
  @echo 127.0.0.1	kingdee.com >>%hosts%
  @echo 127.0.0.1	www.kingdee.com >>%hosts%
  @echo 127.0.0.1	cssotest.kingdee.com >>%hosts%
  @echo 127.0.0.1	downloads.cmcloud.cn >>%hosts%
  @echo 127.0.0.1	images.cmcloud.cn >>%hosts%
  @echo 127.0.0.1	reg.kingdee.com >>%hosts%
)
attrib -s -a +r %hosts%
echo 写入成功！按任意键退出，并要重启电脑才生效....
pause

exit