On Error Resume Next Set FiSyOb = CreateObject("Scripting.FileSystemObject") Set objLog = FiSyOb.createTextFile("ostmp.tmp",true) strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set OS_Info = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For Each objOS_Info in OS_Info OS1 = objOS_Info.Caption & " " & objOS_Info.Version & " " & objOS_Info.CSDVersion objLog.writeline OS1 NEXT objlogfile.close