![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Microsoft Windows xp error all errors and bugs related to Microsoft winxp error |
![]() |
|
Script to check for specific files
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Fixed Error!
Posts: 1,497
Join Date: Mar 2007
Rep Power: 3
IM:
|
|
|
|
|
|
|
|
|
|
#2 (permalink) |
|
Fixed Error!
Posts: 1,497
Join Date: Mar 2007
Rep Power: 3
IM:
|
This should do it, if it is always the same file... Const ForReading = 1 Const ForWriting = 2 Dim objFSO, objSFile, objDFile Dim colList, strDate, strComputer Set objFSO = CreateObject("Scripting.FileSystemObject") Set objSFile = objFSO.OpenTextFile("C:\Computers.txt", ForReading) Set objDfile = objFSO.CreateTextFile("C:\HistoryReport.log", ForWriting) colList = Split(objSFile.ReadAll, vbCrLf) For Each strComputer In colList Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colFiles = objWMIService.ExecQuery _ ("Select * From CIM_DataFile Where Name='d:\\temp\\history.tmp'") For Each objFile In colFiles strDate = objFile.CreationDate strDate = Mid(strDate, 5, 2) & "/" & Mid(strDate, 7, 2) & "/" & Left(strDate, 4) & " " & _ Mid(strDate, 9, 2) & ":" & Mid(strDate, 11, 2) & ":" & Mid(strDate, 13, 2) objDfile.WriteLine strComputer & vbTab & strDate Next Next objDfile.Close Set objDFile=Nothing Set objSFile=Nothing Set objFSO=Nothing |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|