Jump to content

How to make colors flash in a batch file?


Recommended Posts


Copy the code below in a file called SLEEP.VBS and it will take milliseconds. Look at the other code to see how to write your batch with it. It's strange what you wanna do but this is a solution.

SLEEP.VBS

If WScript.Arguments.Count = 1 Then
    WScript.Sleep WScript.Arguments(0)
End If

BATCH FILE

COLOR 07
SLEEP.VBS 500
COLOR 70
SLEEP.VBS 500
COLOR 07
SLEEP.VBS 500
COLOR 70
SLEEP.VBS 500
COLOR 07

Link to comment
Share on other sites

You need to call the VBS with "wscript" or "cscript" to be sure it will run.

And that will take up more time than just the 0.5 seconds you want it to. Just sticking to what's scriptable right within the batch-files sounds better.

One option is to ping 127.0.0.1 for as many times (or milli-secs) as needed to wait. That way, no sleep.exe or VBS is needed. Of course, the COLOR command is simple enough, use it after the inter-mittent pings.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...