1
我是批量編程的新手。我嘗試在批處理腳本中使用IF條件。代碼如下所示。在批處理腳本中使用IF語句
:rmfile
:: removes the file based on it's age.
::
SETLOCAL
set file=%~1
set age=%~2
set thrshld_days=40
if %age% LSS 40
echo.%file% is %age% days old
EXIT /b
現在的問題是,即使文件的年齡超過40我越來越printed.which其實不應該發生的文件。
請幫我在這方面..謝謝!
我的括號嘗試如建議,但沒有運氣:(回聲陳述正在打印每個文件.. – user1749169
非常感謝。它工作.. – user1749169