COMP [-b] file1 file2
-b - Display one screen at a time
file1 - First file name (directory name or wildcards not permitted)
file2 - Second file name (directory name or wildcards not permitted)
Note:
1. COMP will compare files in binary mode.
2. COMP will exit immediately if the lengths of the compared files are
different.
3. COMP will exit if 10 differences encountered.
Examples:
* To compare two files with different lengths:
fs0:\> comp bios.inf legacy.inf
Compare fs0:\bios.inf to fs0:\legacy.inf
Difference #1: File sizes mismatch
[difference(s) encountered]
* To compare two files with the same contents:
fs0:\> comp bios.inf rafter.inf
Compare fs0:\bios.inf to fs0:\rafter.inf
[no difference encountered]
* To compare two files with the same length but different contents:
fs0:\> comp bios.inf bios2.inf
Compare fs0:\bios.inf to fs0:\bios2.inf
Difference #1:
File1: fs0:\bios.inf
00000000: 5F *_*
File2: fs0:\bios2.inf
00000000: 33 *3*
Difference #2:
File1: fs0:\bios.inf
0000000C: 00 00 00 00 *....*
File2: fs0:\bios2.inf
0000000C: 25 32 03 03 *%2..*
[difference(s) encountered]
請問一下如果要寫Script,怎麼讓他自動判斷結果是相同或是不同.
回覆刪除if %1% == yes then
刪除echo "output:" %1
endif
fs0:\> test.nsh yes
output: yes
請問一下如果要寫Script,要怎麼讓他自動判斷他的結果是相同或不同, 有像Windows底下有errorlevel可以看返回值來確認一樣的指令嗎?
回覆刪除你可以使用"err"去檢查error level.
刪除