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