Skip to content

Instantly share code, notes, and snippets.

@tnhung2011
Created December 19, 2025 11:43
Show Gist options
  • Select an option

  • Save tnhung2011/2a8bb6fb5071343befe3a989d8b8f443 to your computer and use it in GitHub Desktop.

Select an option

Save tnhung2011/2a8bb6fb5071343befe3a989d8b8f443 to your computer and use it in GitHub Desktop.
A spinner, demonstrating carriage return in Batch (CR thanks to Jeb - http://ss64.org/viewtopic.php?id=1344)
@if (@X)==(@Y) @end /*
@echo off
setlocal enabledelayedexpansion
::http://ss64.org/viewtopic.php?id=1344
for /F "usebackq" %%a in (`copy /Z "%~f0" nul`) do set "cr=%%a"
set /a idx=0
for %%i in (/ - \ ^|) do (
set spin.!idx!=%%i
set /a idx+=1
)
:spinner
for %%i in (0 1 2 3) do (
<nul set/p"=!spin.%%i!!cr!"
cscript //nologo //E:JScript "%~f0"
)
goto spinner
*/
WScript.Sleep(150);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment