Changing icon at the end of some text?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
samzeman
Posts: 1
Joined: 15 Aug 2014 08:15

Changing icon at the end of some text?

#1 Post by samzeman » 15 Aug 2014 08:24

Okay, I'm new here. Go easy on me because I'm pretty new to batch too. Alright.

So when my computer starts up, at one stage it says
"[Something]... /"
And the slash at the end rotates in this order
/
-
\
|
/
-
So that it looks like a spinning line. I was wondering how to do this without clearing the screen so that the text is left there?

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Changing icon at the end of some text?

#2 Post by Squashman » 15 Aug 2014 09:11

Code: Select all

@Echo OFF
SetLocal EnableExtensions EnableDelayedExpansion
For /f %%a in ('copy /Z "%~dpf0" nul') Do set "CR=%%a"
Set "busy=|/-\"
Set /A n=0

::BUSY SPINNER
For /L %%i in (0,1,100) Do (
   Set /A "n=%%i%%4"
   For /L %%n in (!n! 1 !n!) Do Set /P "=Calculating !busy:~%%n,1! !CR!"<NUL:
   PING -n 1 127.0.0.1 >NUL:
)

disclaimer: not my code. Just Google Searched.

Post Reply