Hey guys -- I have a script that currently checks a number of systems across based on a list of workstations (strFile) on the network for a file's existence (strTarget):
I'd like to modify this to include, in the output, the file's DateCreated property (and/or multiple properties, such as the File's LastModifiedDate and 'Owner', though I've read/understand that the 'Owner' property is a feat unto itself).
My VBS skills aren't at all what I'd like them to be -- I can usually read, understand and modify basic scripts, but I'm having a problem with getting this to do anything other than what it's doing...
Anyone able to provide some assistance?
Thanks in advance...
Code:
Option Explicit
Dim objFSO, strFile, objTextFile, strComputer, strTarget
Const ForReading = 1
strFile = "c:\scripts\servers.txt"
strTarget = "c$\Temp\app.exe"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(strFile, ForReading)
Do Until objTextFile.AtEndOfStream
strComputer = objTextFile.ReadLine
' Skip blank lines.
If (strComputer <> "") Then
If (objFSO.FileExists("\\" & strComputer & "\" & strTarget) = True) Then
Wscript.Echo "exists " & strComputer
Else
Wscript.Echo "not exist " & strComputer
End If
End If
Loop
objTextFile.CloseMy VBS skills aren't at all what I'd like them to be -- I can usually read, understand and modify basic scripts, but I'm having a problem with getting this to do anything other than what it's doing...
Anyone able to provide some assistance?
Thanks in advance...