I do have this very specific question regarding the usage of the ShellExecute verbs from inside a C# application, which uses the ProcessStartInfo class from the System.Diagnostics namespace.
What I do have: a set of files (text and binary), which I want to burn on a CD/DVD using the CD/DVD drive of a Windows 10-installed machine.
What I want to do: from a C# .NET Framework 4.x application (regardless of it is a console one or a windows forms one), I want to run a separate process (Process object) using ProcessStartInfo (where the UseShellExecute property is set to true) and specifying the Verb "SendTo", which should take my set of files and "send" them to the ready CD/DVD drive (the required empty disk has been insert).
You could imagine it like selecting that set of files in the Windows Explorer, right-clicking on this set and selecting "Burn to 'CD/DVD Drive Name'. This same function implemented as C# program.
What I do not want: I do not want to use IMAPI2 interfaces, nor I want to write code in other languages (f.e. C/C++). I also would like to avoid using external applications like cdrtools or cdrtfe, because of the Cygwin dependency.
What I've already tried: I've already tried to form a correct ProcessStartInfo object, but it seems I'm not passing the correct information to the underlying ShellExecute procedure:
var info = new ProcessStartInfo(pathNamesSet)
{
Arguments = "\"" + CDRecorderDrive + "\"",
CreateNoWindow = false,
WindowStyle = ProcessWindowStyle.Normal,
UseShellExecute = true,
Verb = "SendTo"
};
var process = Process.Start(info);
The process ends with the error: 'Win32Exception (1155): The specified file has not been assigned to an application'.
I'm looking for implementation of this specific functionality yet for long time, but still not able to find any useful hints from neither SO nor MS blog pages.
For additional information regarding this specific requirement, pleas ask here.
Thank you in advance for your attention and help.