If this is your first visit, be sure to check out the FAQ. You must register before you can post. Your first post will be checked for appropriate content
(SPAM) - please allow a bit of time for that. After that, you'll be able to post at will!
I have a command running during my computer's startup (I do it from the Windows Startup group, but you could use autoexec.bat if you would rather see the minute the PC starts rather than when Windows is running) which modifies a file called C:\Lastboot.txt. The command is simple: date >c:\lastboot.txt
Then I simply look at the file's last modification date using the functions in my File Properties include. That's the date of the last system boot.
I can use my standard Since string generation include script to convert that datestamp into a string like "Yesterday at 7:11am" or "Saturday at 9:53pm" or "2002-10-11 at 12:15pm".
on XP you could capture this output:
<pre class="ip-ubbcode-code-pre">systeminfo | findstr "Up.Time"</pre>
on Win2k, you could install uptime.exe from the support tools on the win2k CD
You could also download uptime.exe from sysinternals which will run on any OS of your choice (sysinternals.com)
and I found this piece of script in my vbs library, ran fine on XP , didn't test it on any other machines.
<pre class="ip-ubbcode-code-pre">
Dim objFileSystem
Dim objOutputFile
Dim objService
Dim objOSSet
Dim objOS
Dim strWBEMClass
strWBEMClass = "Win32_OperatingSystem"
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer (strServer, strNameSpace,strUserName, strPassword)
ObjService.Security_.impersonationlevel = 3
Set objOSSet = objService.InstancesOf(strWBEMClass)
Comment