Hi!
Been enjoying the dostips'tips and for fun, I want to make myself a small animation snipple displayed in cmd.exe...
But! I can't find (probably bad use of googleing?) a way to delay execution of next command to under a second. One second delay between the .txt
files is just terrible. Soooo, is there a way?
And the "code" could have a better solution I would think, but I don't know where to begin. Right now I'm doing it like this:
cls
type 1.txt
1 second delay
cls
type 2.txt
1 second delay
cls
But could it be possible to just tell cmd.exe to print all the 'txt files one at a time with x delay in-between and enjoy the show?
-Tudelu Kjell
edit:
I forgot, does a "graphics" library exists for cmd? Would be fun having multiple colours!
Just for fun - cmd animation
Moderator: DosItHelp
Re: Just for fun - cmd animation
Yes, you are bad use of googleing.
Code: Select all
@echo off
setlocal enableextensions enabledelayedexpansion
for %%f in (*.txt) do (
cls &color !random:~0,1!!random:~-1!
type "%%f"
ping localhost -n 2 >nul
)
cls &color
echo That's All Folks!
Re: Just for fun - cmd animation
I've read that one! I figured out how to delay between the txt-files, but is 0.5 seconds possible?
Thanks for the 'for and colour thing' tho Just have to name the txt files better so that it fits in.!
If 1 second is minimum all usefulness will be that clock I soon got done.. Humhum
Search continues!
Thanks for the 'for and colour thing' tho Just have to name the txt files better so that it fits in.!
If 1 second is minimum all usefulness will be that clock I soon got done.. Humhum
Search continues!
Re: Just for fun - cmd animation
You need a 3rd party app. You could write your own VBScript using batch.
Note that calling the script takes some time. Thats why write less than 500 if you need 0.5 seconds
Regards
aGerman
Code: Select all
@echo off &setlocal
:: write the script
set "sleep=%temp%\sleep.vbs"
>%sleep% echo WScript.Sleep WScript.Arguments(0)
echo START
:: call the script with milli seconds as the parameter
%sleep% 200
echo END
pause
Note that calling the script takes some time. Thats why write less than 500 if you need 0.5 seconds
Regards
aGerman