@echo off
mode con lines= cols=168
color 0
chcp 65001
%1 Mshta VBScript:CreateObject("Shell.Application").ShellExecute("CMD.exe","/C ""%~0"" ::","","RunAs",1)(Window.Close)&&Exit
Setlocal ENABLEDELAYEDEXPANSION
Set Text="D:\1\123.txt"
Set /P Int=Enter a Int:
For /f "delims=: tokens=*" %%i In ('findstr "*" "%Text%"') Do Set /A Num=!Num!+1 && Set X!Num!=%%i && if %Int%==!Num! echo X!Num!
Echo.
Echo X!Int!:
Echo !X%Int%!
Echo.
Echo X1:
Echo %X1%
Echo.
Echo QTY:
Echo %Num%
Pause
Endlocal
123.txt
apple
love
check
happy
上述程序把下面這段程序拿掉就能順利運作
&& if %Int%==!Num! echo X!Num!
但是就沒辦法比對每次從TXT抓出的次數跟我輸入的Int變數值比對,然後輸出echo X!Num!,請問我是哪裡做錯了呢?~麻煩各位大大解答~感溫