2

How to Get the Time When IIS Started With Classic ASP?

Daniel Silveira
  • 41,125
  • 36
  • 100
  • 121

1 Answers1

3
' This works on my machine... '
Option Explicit
Dim objWMIService, procs, proc, creationDate
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\.\root\cimv2") 

Set procs = objWMIService.ExecQuery ("Select * from Win32_Process where name='inetinfo.exe'")

For Each proc In procs
  creationDate = creationDate & vbCr & proc.CreationDate
Next
Jonas Elfström
  • 30,834
  • 6
  • 70
  • 106
  • Seems to throw "error '80041003'" on my machine unless I disable anonymous access in IIS for the ASP page that executes the above script. – Saul Dolgin Jun 16 '09 at 13:57
  • Sounds like the user that your ASP application runs as does not have enough privileges, maybe temporarily impersonating another user could help: http://support.microsoft.com/kb/248187 – Jonas Elfström Jun 16 '09 at 14:31