How to Write a Script to Display in Windows Time

How to Write a Script to Display in Windows Time thumbnail
VB Script is used to gather and display information during startup.

Scripts are Windows startup programs that take a snapshot of computer settings and display information for the user. Scripts are normally used by administrators to automate some processes each time the user boots up the machine. Scripts can also take the current value of the Windows time and display it in a message box. The script is created in a simple text editor, and it can create a popup or print the output directly in the command line as the script runs.

Instructions

    • 1

      Open a plain text editor. This can be something as simple as Notepad. You can also add a time function to an existing VB Script.

    • 2

      Retrieve the current date. The "Date()" function retrieves the Windows date along with the current time. The code below retrieves this value and assigns it to a variable:
      Dim s as String
      s = Date()

    • 3

      Display the current date to the user in a message box. The code below displays a popup message for the user:
      MsgBox (s)

    • 4

      Display the current date and time within the command prompt as the script continues to run. This is beneficial if you don't want the script to stop using a message box. To print to the console, use the following code:
      Wscript.echo(s)

Related Searches:

References

  • Photo Credit computers screen 2 image by chrisharvey from Fotolia.com

Comments

You May Also Like

Related Ads

Featured