2016-11-21 2 views

답변

3

x 초보다 더 걸리는 경우 종료 전체 스크립트를 바랍니다. X 초 후에 살해 될 프로세스에 대해 제목을 설정해야합니다. 난 그냥 코드를 시뮬레이션 할 수 pause을 퍼트

@echo on 

::The Endtime in seconds 
set "$Time=5" 

::The title of the process to kill after [Endtime] 
set "$Title=test" 

title %$Title% 

::Generating the monitoring process 
(
echo timeout %$Time% 
echo taskkill /F /FI "WINDOWTITLE eq %$Title%" /T) >timer.bat 

::Running the monitoring Process in another thread 
start timer.bat 


::Here come your code 

Pause 

은 당신의 코드로 대체합니다.

+0

좋아 보인다. – orange

+0

나는이 논리를 실제로 run-as-user 스크립트에 사용할 수있다. 감사! – CoveGeek

관련 문제