@echo off setlocal EnableDelayedExpansion echo check unzip file :prepare ::Prepare…
- User
@echo off setlocal EnableDelayedExpansion
echo check unzip file
:prepare ::Prepare Result echo. > st_fail.txt echo. > st_success.txt
:loop cls echo check unzip file
::Read Target set "store_id=st.txt" for /f "usebackq tokens=1 delims=| " %%i in (!store_id!) do call :process "%%i" goto :check
::Main Process :process ::Transform ID set "storeCode=%~1" set "serv_id=PTH%~1"
::Check Connection ping !serv_id! -n 1 -w 1000> nul ::echo ping Working !serv_id! if errorlevel 1 ( echo %~1 >> st_offline.txt & echo %~1 is Offline & goto :next ) ::else ( echo %~1 is Online )
::Check File set "result="
osql -UTRANSF -PFSNART -S!serv_id! -Q "exec xp_cmdshell 'dir c:\windows\system32\unzip.exe'" > result.txt findstr /c:"unzip.exe" result.txt > nul if not errorlevel 1 ( set "result=found" & del /q result.txt > nul & echo %~1 Found !result! ) else ( echo %~1 not Found )
::IF Yes, then Success if defined result ( echo %~1 >> st_success.txt goto :next )
::IF No, then Fail echo %~1 >> st_fail.txt
:next exit /b 0
:: Check the current time :check
goto loop
:end echo. echo Script finished process all target. pause
endlocal
make create worker_!store_id!.txt in worker folder and before ::read target making check amoun of file in worker folder if more than 10 files pasue
- Assistant
- User
can make call :process in same time
- Assistant