Skip to content

Instantly share code, notes, and snippets.

@RiverSongFox
Created October 21, 2015 11:06
Show Gist options
  • Select an option

  • Save RiverSongFox/be2fb05ab0fd43801558 to your computer and use it in GitHub Desktop.

Select an option

Save RiverSongFox/be2fb05ab0fd43801558 to your computer and use it in GitHub Desktop.
Set oShell = CreateObject("WScript.Shell")
strHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
strLogFolder = strHomeFolder + "\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.MSO"
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFS.GetFolder(strLogFolder)
Dim oMoment: oMoment = Now()
Do
Set oFiles = oFolder.Files
For Each oFile In oFiles
If Right(oFile.Name, 4) = ".log" And oFile.DateCreated >= oMoment Then
strFullPath = strLogFolder + "\" + oFile.Name
CreateObject("WScript.Shell").Run("""" + strFullPath + """")
End If
Next
oMoment = Now()
WScript.Sleep 2000
Loop
@RiverSongFox
Copy link
Author

Office Log Watcher

Open Excel error log files frrom Content.MSO directory automatically

Save this Gist into local .vbs scenario and execute it.
Unfortuantely, the script may be stopped only via Task manager (look for wscript.exe process).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment