Skip to content

Instantly share code, notes, and snippets.

@jp311
Created August 22, 2012 09:47
Show Gist options
  • Select an option

  • Save jp311/3424072 to your computer and use it in GitHub Desktop.

Select an option

Save jp311/3424072 to your computer and use it in GitHub Desktop.
批处理中显示进度
@echo off
setlocal enabledelayedexpansion
set "progress=-\|/"
for /l %%i in (0, 1, 100) do (
REM 取余运算符为 %%,帮助里的 "%" 方式无效
set /a p=%%i %% 4
cls
call set "o=%%progress:~!p!,1%%"
echo Progressing: !o!
REM Handle command
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment