
StrTempFilePath = WScript.CreateObject("Scripting.FileSystemObject").GetSpecialFolder(2) & "\TEMP.M4A" StrFileName = Replace(strFilePath, strFolder, "") StrFilePath = Replace(strFilePath, Chr(34), "") StrFilePath = Replace(strFilePath, "\\", "\") Set objLatestEvent = colMonitoredEvents.NextEvent Set colMonitoredEvents = objWMIService.ExecNotificationQuery ("SELECT * FROM _InstanceCreationEvent WITHIN " & nFrequency & " WHERE Targetinstance ISA 'CIM_Director圜ontainsFile' and TargetInstance.GroupComponent='Win32_Directory.Name=""" & strQueryFolder & """'") $action = !\\" & strComputer & "\root\cimv2") # DEFINE ACTIONS AFTER AN EVENT IS DETECTED $watcher = New-Object System.IO.FileSystemWatcher StartMonitoring.ps1 # SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO 19:22:14, Deleted, D:\source\New Text Document.txt 19:22:09, Changed, D:\source\New Text Document.txt 19:22:04, Created, D:\source\New Text Document.txt You can replace the action and do whatever you want e.g call an external tool Example log file This script monitors a certain folder and writes a logfile.
#File monitor microsoft windows
It can be used since Windows Vista (.NET and PowerShell is preinstalled) without any additional tools. dllhost.At work we use Powershell to monitor folders. General processes which normally can be excluded: svchost.exe, procexp(64).exe, office applications, services.exe, explorer.exe, wmpnetwk.exe, taskhost.exe, lsass.exe, wmiprvse.exe.You may be able to identify a process by right-clicking on it, and choosing "Properties", tab "Process".So you may want to include csrss.exe, to trace at what moment an error occurs which was written to the Windows event log - the step just before starting 'Werfault.exe' would be the application creating the error. when an application error message is added to the Windows Event logs, the Windows process name csrss.exe accesses the path c:\windows\system32\WerFault.exe.That way, you can see what credentials are used to start a specific process you can add the column 'User name' by right-clicking on the column headers.the column 'result' may give error messages which do not mean anything at all, in some cases Windows will just try to access files in different paths.


Disable registry, network and process trace by pressing these buttons:

In most trouble shooting scenarios, file tracing is enough. When started, MPM will automatically start showing all processes currently running, with registry, file, network and process activity.
#File monitor microsoft license
On first run, you will have to confirm to a license agreement. The tool does not have to be installed, just run it from the new location.
#File monitor microsoft archive
Just copy the contents of the archive file to a new folder on the PC or server where you want to trace the problem, for example to C:\Program Files (x86)\Microsoft Process Monitor. Please note that MPM is not an Exact tool and not supported as such. Microsoft Process Monitor (MPM) can be used to trace problems related to file or registry access, or to show which process may be the last to execute before an error occurred.
