Using the net statistics Workstation command, I have scripted WhenStarted.bat to return the date and time that the local computer was started.

NOTE: The date and time that the Workstation service started is actually returned, but that should be close enough.

The syntax for using WhenStarted.bat is:

WhenStarted DateStarted TimeStarted

where DateStarted is a call directed environment variable that will contain the date that the Workstation service started, and TimeStarted is a call directed environment variable that will contain the time that the Workstation service started.

WhenStarted.bat contains:

                              @echo off                              if \{%2\}==\{\} @echo Syntax WhenStarted Date Time&goto :EOF                              for /f "Tokens=1-3*" %%a in ('net statistics Workstation^|Find "Statistics"') do (                               set %1=%%c                               set %2=%%d                              )