Created
October 21, 2015 11:06
-
-
Save RiverSongFox/be2fb05ab0fd43801558 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Office Log Watcher
Save this Gist into local
.vbsscenario and execute it.Unfortuantely, the script may be stopped only via Task manager (look for
wscript.exeprocess).