I have asked this before and almost got it worked out but here goes.
The backup is scheduled daily at 11:00 PM and writes a file for that backup log. It goes from backup01-backup10 and overwrites after ten days. It doesn't start in any particular order so I never know what backup log to print. I want to automate so each day the backup log prints the latest log a printer. I want to setup a batch file that automatically prints the newest file.
I have setup a vbs file from another post but it doesn't work. I will post it here. I thought it worked but it does not. I will end up replacing logs with the path for the backup logs but that is all. I am desperate to get this resolved. Please help.
Dim LatestDate, MyCmd
Set Shell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set FS = objFSO.GetFolder("C:\logs")
For Each fl In FS.Files
If FL.DateCreated > LatestDate Then
set NewestFile = fl
LatestDate = fl.DateCreated
If Not NewestFile is nothing Then
'NewestFile = chr(34) & NewestFile & Chr(34)
MyCmd = "cmd /c copy " & NewestFile & " lpt2"