Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
@echo off
Title clock
@mode con cols=30 lines=7
color 03
: main
cls
echo.
echoTime: %time%
echo.
echo Date: %date%
echo.
ping -n 2.0.0.0.0>nul
goto main


What I have tried:

I am trying to design an analog clock.
Posted
Updated 13-Sep-23 6:48am
v2

I really wouldn't use VBScript, or any other command line based batch processing language for this: You would be much better off learning VB (or better C#) and creating this as a GUI app where it won't waste so much processing time and will flicker less.

But ... spaces are important:
VBScript
echo.
echoTime: %time%
echo.
echo Date: %date%
Without a space between "echo" and "Time" the system looks for a command "echoTime" and doesn't find it.
 
Share this answer
 
That code is for a digital clock. See VBScript Tutorial[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900