3

コマンドライン(win7 cmd)を介して4つのタスクを並行して実行します。

start defrag /A c:
start defrag /A d:
start defrag /A e:
start  defrag /A f:
dir 

ただし、dirコマンドは最初の行の直後に実行されます。

dir4つすべてが完了した後にコマンドを実行したい。

どうすればいいですか?

4

3 に答える 3

5

これを試して:

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 
于 2012-10-26T13:43:59.873 に答える