Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ディスクをリモートでデフラグしたい。この短いスクリプトを試しました:
for /f "delims=" %%s in (servers.txt) do ( at \\%%s 20:00 defrag.exe c: -f ) @pause
通常、他のコマンドは機能しping %%sます。残念ながら、「at」コマンドを使用すると機能しません (コマンドは最初のサーバーで「ループ」し、その後 CMD ウィンドウが閉じます)。
ping %%s
at
私は何を間違っていますか?
defrag.exe c: -fは引用符で囲む必要があると思います。
defrag.exe c: -f
for /f "delims=" %%s in (servers.txt) do ( at \\%%s 20:00 "defrag.exe c: -f" ) @pause