We all know showing a loading kind of effect on cmd console is such a dirty task to do. Because we need to loop through a code unnecessarily and clear the console each time a loading effect occurs on the console.
It makes our program bulky, as well as making a blinking screen, while we use the CLS command each time in the iteration. So in this post, I am going to show you a cmd trick to show a simple loading effect in cmd (without the CLS command).
HOW TO SHOW SIMPLE LOADING EFFECT IN CMD (WITH NO CLS COMMAND)
So, how were they able to do that loading effect? Here, in this post, we are going to know about the method of Microsoft or some similar method that Microsoft might have used in their old programs.
The question was asked to #TheBATeam on our Facebook page by someone, who is much curious to know things as we are. So, here we are replying to his answer as well as helping someone else, who would have the same or similar question in their mind.
Now, let’s get on to solving the problem! I’m going to use the unique property of ‘SET’ command in batch programming, and a few of the Handle options, which allow us to redirect the input or output Handles of a certain command in Batch.
Try out the following code:
@echo off cls echo. echo. set /p ".=Loading" <nul timeout /t "1" >nul set /p ".=." <nul timeout /t "1" >nul set /p ".=." <nul timeout /t "1" >nul set /p ".=." <nul timeout /t "1" >nul set /p ".=." <nul timeout /t "1" >nul set /p ".=(Done)" <nul pause
HASH Code - For Verification - (SHA-256) fa2e24c48d156c9e6a2557d2ef2bf462f80686a9d0a2eb51ab7e6af8680c2f86
From The Editors Desk
We hope you enjoyed this solution to a community requested problem! If you have questions, contact us below in the comments, or join our Whatsapp, Telegram or Discord!
Keep learning, keep sharing….TheBATeam
Be happy, spread happiness…