判斷網絡是否通斷,服務是否存在的BAT批處理(轉)
@echo off title DDI自檢程序 echo. echo. ping -n 2 www.baidu.com>%temp%\1.ping & ping -n 2 www.baidu.com>>%temp%\1.ping if %errorlevel%==0 (echo √ 外網正常) else (echo × 外網不通) echo. ::ping -n 2 192.168.1.1>%temp%\2.ping ::findstr "TTL" %temp%\2.ping>nul ::if %errorlevel%==0 (echo √ 網關正常) else (echo × 網關不通) ::echo. ::ping -n 2 192.168.1.2>%temp%\3.ping ::findstr "TTL" %temp%\3.ping>nul ::if %errorlevel%==0 (echo √ 內網正常) else (echo × 內網不通) ::echo. ping -n 2 127.0.0.1>%temp%\4.ping findstr "TTL" %temp%\4.ping>nul if %errorlevel%==0 (echo √ TCP/IP協議正常) else (echo × TCP/IP協議異常) if exist %temp%\*.ping del %temp%\*.ping echo. set checked=0 if exist "%windir%\Microsoft.NET\Framework\v4.0*" set checked=1 if exist "%windir%\Microsoft.NET\Framework\v4.5*" set checked=1 if exist "%windir%\Microsoft.NET\Framework\v4.7*" set checked=1 if %checked% EQU 1 (echo √ .NET Framework已安裝) else (echo × .NET Framework4.0未安裝) echo. sc query DDIClientAppService >nul if %ErrorLevel% EQU 0 (echo √ 服務存在) else (echo × 服務不存在) echo. sc query "DDIClientAppService" |findstr /i "RUNNING" >nul &&echo √ 服務正在運行 ||echo × 服務未運行 echo. echo. pause
活到老,學到老。

浙公網安備 33010602011771號