[Sync Time] - A Script2Service Demo Project
This service retrieves time from a number of Internet Time servers and adjust the computer clock every two hours.
Source Files
|
S2S_TimeSync.js
|
The main script file, implementing a infinit loop that adjust the computer clock every 2 hours until the service stops.
|
|
GetNetTime.js
|
Get Internet time using UDP.
|
Build and install the Service
- Download the project package.
In the 'Service' sub-folder, you will find the service program file 'S2S_TimeSync.exe'.
You can re-build it using Script2Service.
- Open a console window and change the current directory to where 'S2S_TimeSync.exe' is.
- Type 'S2S_TimeSync /install' to install the servive.
- Type 'S2S_TimeSync.exe /start' to start the service or 'S2S_TimeSync.exe /um' to run it in interactive mode.
Call service functions from outside
In the 'App\WScript' sub-folder, there is a javascript file named GetTime.js
This is a programm for the Windows 'CScript/WScript'.
- Open a console window and change the current directory to where 'GetTime.js' is.
- Type 'CScript GetTime.js'