Using standard commands, I have scripted WhenStarted.bat to return the date and time that your computer was last started.

The syntax for using WhenStarted.bat is:

WhenStarted Date Time

Where:

<b>DATE</b> is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will contain the date your computer was started,
     using your short date format.

<b>Time</b> is a <a href="/article/jsifaq/jsi-tip-5535-how-can-i-cause-a-called-batch-file-to-return-a-call-directed-environment-variable-.aspx">call directed environment variable</a> that will contain the time your computer was started.
WhenStarted.bat contains:
@echo off
if \{%2\}==\{\} @echo WhenStarted Date Time&goto :EOF
for /f "Tokens=3,4" %%a in ('net statistics server^|Find "Statistics since"') do (
 set %1=%%a
 set %2=%%b
)