2014-08-28 75 views

回答

0

基於C-toesca的答案,這裏是代碼:

:: These are parameters that are passed into the script 
set file1=%1 
set file2=%2 

:: Extracting the contents of the files 
for /f "tokens=1* delims=" %%c in ('type "%file1%"') do set file1_value=%%c 
for /f "tokens=1* delims=" %%c in ('type "%file2%"') do set file2_value=%%c 

:: Comparing the values 
IF "%file1_value%" EQU "%file2_value%" (
    dirToChrome.exe 
) ELSE (
    exit 
) 
0

什麼是文件1的html文件和file2? (該文件的哈希值,文件名等?)

比較兩個字符串(文件名,例如文件哈希):

set file1=%1 
set file2=%2 

IF %file1% EQU %file2% (
    dirToChrome.exe 
)ELSE (
    exit 
) 
相關問題