コマンドライン(win7 cmd)を介して4つのタスクを並行して実行します。
start defrag /A c:
start defrag /A d:
start defrag /A e:
start defrag /A f:
dir
ただし、dir
コマンドは最初の行の直後に実行されます。
dir
4つすべてが完了した後にコマンドを実行したい。
どうすればいいですか?
これを試して:
start defrag /A c:
start defrag /A d:
start defrag /A e:
start defrag /A f:
:StartLoop
:: Check whether any of the defrags are running...
tasklist|Findstr /i /c:"defrag"
:: Exiting the loop if tasklist didn't find any defrags.
If %errorlevel% NEQ 0 (
GoTo :ExitLoop
)
choice /T 10 /D Y /M "Waiting for 10 seconds..."
GoTo :StartLoop
:ExitLoop
dir