2013-03-17 2 views
3

지정된 시간에 배치 파일을 통해 응용 프로그램을 시작하고 싶습니다.지정된 시간까지 배치 파일 대기

@echo off 
start notepad c:\test.txt 

그러나 배치 파일을 지정된 시간에 시작하려면 어떻게해야합니까? 시간은 배치 파일에서 언급 될 것입니다.

답변

1

이를 사용할 수 있습니다

@echo off 
timeout 5 
start notepad c:\test.txt 
+0

이 작품에 대한 문서이지만, 제한 시간 동안 표시되는 콘솔을 숨길 수있는 방법은 무엇입니까? –

+0

ping 명령이 떠오른다. 배치 파일에서 수면하는 방법을 검색하면 수백만 가지가 생깁니다. –

2

at 명령은 매우 유망한 보인다. this을 읽어보십시오.

at 15:00 "echo Done"을 넣으면 명령 프롬프트는 같은 날 오후 3시에 "완료"를 출력합니다.

이것은 at 명령

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]] 
AT [\\computername] time [/INTERACTIVE] 
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command" 

\\computername  Specifies a remote computer. Commands are scheduled on the 
        local computer if this parameter is omitted. 
id     Is an identification number assigned to a scheduled 
        command. 
/delete   Cancels a scheduled command. If id is omitted, all the 
        scheduled commands on the computer are canceled. 
/yes    Used with cancel all jobs command when no further 
        confirmation is desired. 
time    Specifies the time when command is to run. 
/interactive  Allows the job to interact with the desktop of the user 
        who is logged on at the time the job runs. 
/every:date[,...] Runs the command on each specified day(s) of the week or 
        month. If date is omitted, the current day of the month 
        is assumed. 
/next:date[,...] Runs the specified command on the next occurrence of the 
        day (for example, next Thursday). If date is omitted, the 
        current day of the month is assumed. 
"command"   Is the Windows NT command, or batch program to be run. 
+0

서식을 붙여 넣을 때 서식이 조금 어둡습니다. –

+0

배치 파일에서 'at'을 사용하면 아무 것도하지 않았습니다. 명령 프롬프트에서 사용했을 때 다음과 같이 말했습니다 : "AT 명령은 더 이상 사용되지 않으므로 대신 schtasks.exe를 사용하십시오." 윈도우 8을 사용하고 있습니다. –

+0

개인적으로 schtasks가 너무 혼란 스럽기는하지만'schtask/create /? '를 넣어서 구문을 찾을 수 있습니다. –