@echo ******************************
@echo **  Welcome Smart.Net
@echo ******************************

@不在ALPHA处理器的机器上运行
if "%PROCESSOR_ARCHITECTURE%" == "ALPHA" goto End

@自动分发文件
:Copy
@echo ******************************
@echo ** Check and Copy Files
@echo ******************************

@客户端为Windows 9.x
if not "%OS%" == "Windows_NT" goto 9xCopy 

@客户端为Windows 2000/XP 或者NT4
if exist %windir%\inf\netrlw2k.inf (xcopy %0\..\*.*  %windir%\smartnet\ /d /k /q /r /c /y) else (xcopy %0\..\*.*  %windir%\smartnet\ /d /k /q /r /c)
goto :Check_OCX

:9xCopy
xcopy %0\..\*.*  %windir%\smartnet\ /d /k /q /r /c /y

@检查控件
:Check_OCX
@echo ******************************
@echo ** Check OCX
@echo ******************************
set systempath=%WINDIR%\SYSTEM\
if "%OS%" == "Windows_NT"  set systempath=%WINDIR%\SYSTEM32\
if not exist %systempath%richtx32.ocx goto install_ocx

@自动启动客户端
:Launch
@echo ******************************
@echo ** Launch CCEC Smart Info...
@echo ******************************
call %windir%\smartnet\smtlch.exe

goto End

@自动注册richtx32.ocx
:install_ocx
@echo ******************************
@echo ** register OCX
@echo ******************************
%systempath%regsvr32 /s %windir%\smartnet\richtx32.ocx
goto Launch

:End
