垃圾之简易检测是否安装某软件

@echo off
:start
if not exist notinstall.txt goto :next
more notinstall.txt >java_pcname.txt
:next
if not exist offline.txt goto :run
if not exist notinstall.txt more offline.txt >java_pcname.txt
more offline.txt >>java_pcname.txt
if exist notinstall.txt del /f/q notinstall.txt
del /f/q offline.txt
:run
if not exist java_pcname.txt goto :eof
(for /f %%i in (java_pcname.txt) do (
    @ping -n 1 %%i |find "TTL">nul && (
        (dir "\\%%i\c$\Program Files\java\" 2>nul |find "jre1.8">nul && echo %%i installed || dir "\\%%i\c$\Program Files (x86)\java\" 2>nul |find "jre1.8">nul  && echo %%i installed) && echo %%i>>installed.txt || echo %%i notinstall &&echo %%i>>notinstall.txt
        echo ******************** 
        ) 2>&1 ||(
        echo %%i offline &echo %%i>>offline.txt& echo ********************
        ) 2>&1
    )
)>>log.log
echo.>>log.log
echo.>>log.log
echo.>>log.log
echo ----------------------------------->>log.log
echo %date% %time%>>log.log
echo ----------------------------------->>log.log
echo.>>log.log
echo.>>log.log
echo.>>log.log
echo.>>offline.txt
ping -n 3600 127.1 >nul
goto start

标签: none

评论已关闭