batch-file - Windows 批量回显倒计时
问题描述
我有一个带有 for 循环的脚本,但我想更改回显行,以便它包含剩余的重试次数。
以下是我的最新尝试,但我无法显示重试次数:
rem Will loop 20 times with 30 second intervals (Total 10 minutes) to confirm deletion. Loop will exit after 20 attempts and move on if dll cannot be deleted.
for /l %%i in (1,1,20) do (
set /a "count=20-=%%i"
del /f /q "%Folder2Del%file*.dll" >nul
if not exist "%Folder2Del%file*.dll" goto Folder2Del
echo/
echo File locked! Will try to delete %count% more times before exit.
timeout /t 30 >nul
)
我已经搜索并尝试应用许多示例,但我无法让它发挥作用。我不知道如何正确设置我的“计数”变量。
解决方案
推荐阅读
- python - 如何将特定文件(包含在数据框中的文件)从一个文件夹复制到另一个文件夹
- qt - 如何将 QT 应用程序部署到 Apple 的 Test Flight?
- kubernetes - 如何在 kubernetes 集群中启用“ttlAfterFinished=true”?
- python - 我创建了我的 LSTM Keras2 模型,使用 AveragePooling2D,但 NameError: name 'AveragePooling2D' is not defined
- python - 如何启用 vs code 终端?
- python - 如何将输入用作列表
- java - Java类中的未知变量
- html - 我想在“mat-select”中创建嵌套的“mat-option”
- android - 如何使用 Kotlin 为可绘制的矢量设置动画以旋转几次?
- jquery - 当 Dropzone.js 完成该过程时获取图像名称