나는 다음과 같은 주석 배치 파일을 사용하는 것이 좋습니다 :
나는이 시도 사용하는 명령을 이해
@echo off
cd /D C:\Temp\PDFBatch
:ResetCount
set "WaitCount=0"
rem Search in set directory for *.pdf files (not directories) with
rem archive attribute set. For each PDF file having archive attribute
rem set, remove the archive attribute and open the PDF file by default
rem application for PDF files.
:OpenLoop
for /F "delims=" %%I in ('dir *.pdf /AA-D /B 2^>nul') do (
%SystemRoot%\System32\attrib.exe -a "%%I"
start "" "%%I"
)
rem Wait 60 seconds before next loop run.
%SystemRoot%\System32\timeout.exe /T 60
rem After 3 hours (180 minutes) delete all PDF files older than 2 days.
set /A WaitCount+=1
if not %WaitCount% == 180 goto OpenLoop
rem Delete files older than 2 days in current folder.
%SystemRoot%\System32\forfiles.exe /p "C:\Temp\PDFBatch" /m *.pdf /D -2 /C "%SystemRoot%\System32\cmd.exe /c del @PATH"
goto ResetCount
을 그들이 작동하는 방법, 명령 프롬프트 창을 열고이 실행 다음 명령을 실행하고 각 명령에 대해 표시된 모든 도움말 페이지를 매우 신중하게 읽습니다.
attrib /?
cd /?
del /?
dir /?
echo /?
for /?
forfiles /?
-
start /?
set /?
rem /?
timeout /?
읽기 또한 Microsoft 문서에 대한 Using Command Redirection Operators2>nul
에 대한 설명. Windows 명령 인터프리터 프로세스가 별도의 명령 과정에 포함 된 dir
명령 줄을 실행위한 명령 을 실행하기 전에이 명령 줄이 시작되면 리디렉션 연산자 >
이 명령 라인에 대한 에 캐럿 문자 ^
로 이스케이프해야합니다 리터럴 문자로 해석 할 백그라운드에서.
작동하지 않는 기능은 무엇입니까? –
스크립트를 실행할 때 전혀 작동하지 않습니다. 대체 명령을 시도 중입니다. – Logesh