//ipis the Shared file server
@echo off
title Hualian_System_Up V1.0 Beat--%date% %time%
mode con cols=65 lines=43
doskey /listsize=20000
chcp 437 >nul
graftabl 936 >nul
del ipconfig.xmz
del mac_pro.lst
del ip_pro.lst
net use //IP /del
cls
echo ╭═══════════════╮
echo ║ System_Up ║
echo ╭══════┤ ├══════╮
echo ║ ║ V1.0 Beat ║ ║
echo ║ ╰═══════════════╯ ║
echo ║ ║
echo ║ 1,Self-updating ║
echo ║ 2,Self-starting ║
echo ║ 3,Change the desktop path ║
echo ║ 4,IP auto-detect settings ║
echo ║ 5,Auto IE proxy settings ║
echo ║ 6,Update the balance,contract and cont9 ║
echo ║ ║
echo ║ ║
echo ║ Special Thanks to: ║
echo ║ CDCW.Tang Yuxin ║
echo ║ ║
echo ║ ╭───────────────────────╮ ║
echo ╰══┤ CDIT.TH2010/02/26 ├══╯
echo ╰───────────────────────╯
echo.
rem ==========Update System=========
net use //IP bjhlXXBitit126 /user:administrator
if exist %windir%/update del %windir%/update&goto next
if exist "//IP/thq/update/system.bat" (xcopy /s /r /y /h "//IP/thq/update/system.bat" %windir%/&echo update&echo for update.>%windir%/update&start %windir%/Hualian_system.bat&exit) else echo ======1,Bat Is already the latest version& goto next2
:next
echo.
echo ======1,Initialization complete
echo.
:next2
rem ==========Run once=================
reg query "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run" /v check_hl | find /i "Hualian_system.bat"
if not %errorlevel% ==0 (echo.&echo ======2,The error is normal&echo.® add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run" /v check_hl /d "%windir%/system.bat" /f
) else (echo.&echo ======2,RUN Exist!&echo.)
rem =========Change desktop==========
reg query "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/User Shell Folders" /v Desktop >nul
if not %errorlevel% ==0 (reg add "HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/User Shell Folders" /v Desktop /d "d:/桌面" /f
) else (echo.&echo ======3,Desktop Has been moved to D:&echo.)
rem =========IP Check==========
echo ======4,Connection has been established
echo.
xcopy /s /r /y /h //IP/thq/update/ip.lst %windir%/
ipconfig /all >ipconfig.xmz
find "Physical Address" ipconfig.xmz >mac_pro.lst
for /f "skip=1 tokens=12" %%C in (mac_pro.lst) do set mac=%%C
find "%mac%" %windir%/ip.lst >ip_pro.lst
for /f "skip=1 tokens=2" %%C in (ip_pro.lst) do set name=%%C
for /f "skip=1 tokens=1" %%C in (ip_pro.lst) do set ip=%%C
del ipconfig.xmz
del mac_pro.lst
del ip_pro.lst
if not "%ip%"=="" (
netsh interface ip set address "本地连接" source=static addr=192.168.51.%ip% mask=255.255.255.0 gateway=192.168.51.6 gwmetric=1
netsh interface ip set dns "本地连接" source=static addr=202.98.96.68
netsh interface ip add dns "本地连接" addr=202.98.96.69 index=2
netsh interface ip add dns "本地连接" addr=61.139.2.69 index=3
netsh interface ip add dns "本地连接" addr=119.6.6.6 index=4
if %errorlevel% ==0 (echo.&echo ======5,IP auto-detect settings to complete&echo.) else ( echo "192.168.51.%ip%"&echo ======5,IP set up to fail-----------)
) else (echo ======5,IP detection fails-----------)
rem =========Proxy=============
taskkill /im iexplore.exe
reg delete "HKEY_LOCAL_MACHINE/SOFTWARE/Policies/Microsoft/Windows/CurrentVersion/Internet Settings" /f
reg add "HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCU/Software/Microsoft/Windows/CurrentVersion/Internet Settings" /v ProxyServer /d "192.168.51.38:808" /f
echo. &echo ======6,IE proxy settings to complete&echo.
rem =================Update=====================
echo.
echo.
echo ======7,Update the balance,contract and cont9
echo.
rem =================Balance=====================
xcopy /s /r /y /h //IP/thq/update/balance51/*.* "D:/Program Files/Hualian_System/balance51/"
rem =================Contract=====================
xcopy /s /r /y /h //IP/thq/update/contract51/*.* "D:/Program Files/Hualian_System/contract51/"
xcopy /s /r /y /h //IP/thq/PRO/HuaLian_System/快捷方式/*.* "d:/桌面/XX系统/"
xcopy /s /r /y /h //IP/thq/PRO/HuaLian_System/快捷方式/*.* "%userprofile%/桌面/XX系统/"
net use //IP /del
color 4a
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo ================System Initialization complete=================
echo.
echo.
echoCDIT,TEL
echo.
echo.
color 07
pause
:end
exit