@echo off :START set VERZ=%~dp0 set computer_list=%verz%\rechner.txt set TPM=%verz%\LOGS\TPM.log set TDATEI=\\%%c\c$\TPMT2.log for /F %%c in (%computer_list%) do ( PING -n 1 %%c if exist %TDATEI% echo %%c >> %verz%\LOGS\LOGDATEIDA.log if errorlevel 1 ( echo %%c >> %verz%\LOGS\rechnererr.log ) else ( if not exist %TDATEI% ( copy "%VERZ%HardwareReadiness.ps1" "\\%%c\c$\temp\HardwareReadiness.ps1" echo %%c >>%TPM% psexec -s \\%%c Powershell -ExecutionPolicy Bypass -File c:\temp\HardwareReadiness.ps1 >>%TPM% copy "%VERZ%\TPM.log" "%TDATEI%" echo Server %%c online>> %verz%\LOGS\rechnerueberprüft.log ) ) ) goto START pause