This guide will allow you to make a cool clock using the command prompt in windows. The clock is in digital format and can be changed to any colour you wish by using colour codes in the code. Read below to find out how you can do it.

Firstly you need to open notepad. You can do this in one of two ways; by going to the start bar and then looking through your list of programs to find it or you could do it the 1337 way, which of course is to use the Win+R key combination (Windows key + R). Doing this will open up a small dialogue in the bottom left of the screen. Now, to open notepad you will need to type into the dialogue box “notepad”. Once you have typed this and clicked “OK” or pressed “Enter” notepad will open.

 

Now that you have opened notepad you can begin coding your cmd clock program. The code you will need to type into notepad to create your batch script program is as follows:

——————————————————————————-

@echo off
title DOS-Based Clock
color 0a
cls

   :CLOCK

cls
echo The current time is: %time%
goto CLOCK

——————————————————————————-

 

Once you have typed or copied that code into notepad you will need to save it as a .bat file. To do this you will need to hit Ctrl+S or go to File/Save. Now, you need to be careful to make sure you don’t accidentally save it as a text (.txt) file. To change the file type of which you are saving to you need to click the box next to “Save as type” and then select “All files”. Now in the filename text box you will save the file to a directory of your choice as “clock.bat”. Be sure that you have selected “All files” and that you have remembered to save it as “clock.bat”.

 

Now, once you have saved the file you will need to open the batch file. When you open the batch file the program will load and will look like this:

Untitled

As you can now see, this program will tell you the time to the millisecond.

Now you know how easy it is to make a command prompt clock. If you would like to know how to make a clock that tells you the date and the time then focus your eyes on my other cmd guides for the “How to make a clock with the time and date”. Enjoy your newfound cmd knowledge.

Advertisements