我摘录了我正在使用的批处理文件的一部分。我正在尝试制作进度条,而不是超时输出的数字计数。
\n我的问题是,如何在循环中动态修改字符串,而不必重新输入字符串的每一步?
\n\n@echo off\n\nsetlocal enabledelayedexpansion\n\n:: This is to set variables that represent backspace and carriage return. \n:: I begin strings with these, instead of ending strings with only CR,\n:: so that the cursor isn\'t flashing under the first character of the \n:: progress bar. Beginning each string with a space, and ending each \n:: with !CR! only is another possible workaround.\n\nfor /f %%a in (\'copy /Z "%~dpf0" nul\') do set "CR=%%a"\nfor /f %%a in (\'"prompt $H&for %%b in …Run Code Online (Sandbox Code Playgroud)