Hello
I would like to check several files whether they have been changed.
I have already found a VBS code via google, it also works perfectly with a single file.
But unfortunately I don't know how to use it to check multiple files.
I wanted to try this in batch, but unfortunately without success
Batch Code:
VBS CODE:
I hope that someone here can help me.
Many Thanks
I would like to check several files whether they have been changed.
I have already found a VBS code via google, it also works perfectly with a single file.
But unfortunately I don't know how to use it to check multiple files.
I wanted to try this in batch, but unfortunately without success
Batch Code:
Code:
dir /b c:\tmp\*.cfg >> C:\temp\CFG.txt
for /f %%i in (C:\temp\CFG.txt) do cscript C:\batch\CFG.vbs c:\tmp\%%i
VBS CODE:
Code:
param = WScript.arguments.item(0)
sFile = "& param"
lInterv = 3000'30 s
If WScript.Arguments.Count > 0 Then sFile = WScript.Arguments(0)
If WScript.Arguments.Count > 1 Then lInterv = WScript.Arguments(1)
'MsgBox "Ueberwachung von " & sFile & vbCrLF & "gestartet, Intervall: " & lInterv / 1000 & " Sekunden"
Set fso = CreateObject("Scripting.FileSystemObject")
bRun = True
sTimeStamp = fso.GetFile(sFile).DateLastModified
Do While bRun
Do While fso.GetFile(sFile).DateLastModified = sTimeStamp
WScript.Sleep lInterv
Loop
sTimeStamp = fso.GetFile(sFile).DateLastModified
iRet = MsgBox("Datei " & sFile & " wurde geaendert." , 65, sTimeStamp)
If iRet = vbCancel Then bRun = False
Loop
I hope that someone here can help me.
Many Thanks