I have been unsuccessful at finding any reliable way to detect when a CD/DVD burn process starts. The burning tool will only be file explorer.
I know there is an event log "The IMAPI CD-Burning COM Service service was successfully sent a start control."
The problem with this is that this (and the corresponding stop) will be triggered even if a burn never took place. It seems certain things like WMP will trigger that event when you initialize (click on the burn tab).
What I need is a method (wmi, imapi, whatever) that will inform me anytime the burn process actually starts.
Unfortunately I do not know enough powershell to even know where to start looking. I am just googling wildly in the dark at this point hoping that someone did something close enough to what I want and have not yet been able to find anything.
Thank you,
Thanks for the help. What I have discovered since asking is that at least in Windows 7 but possibly other versions of Windows does an exclusive lock on the CD drive just before it does a write. This is discussed in the IMAPI reference dox on MSFT. This is actually done by just about every burning app not just file explorer to prevent multiple things from messing up the write process.
An event is sent to System with the id code 133 by cdrom which can be monitored to detect when a burn is started. This event only seems to be generated when a burn starts and not by other things like those discussed in the OP.
The following code snippet will attach an event listener and when the event shows up it will react.
I do not know powershell or windows that well so if anyone has suggestions to make this example better I welcome suggestions This however appears to be functional.