6

I suspect this may apply to multiple programming languages, but in this context I am referring to .NET.

When I use System.Diagnostics.Process.Start, I can include, as an argument, a System.Diagnostics.ProcessStartInfo object. One of the properties of ProcessStartInfo class is Verb (type of string). There is also a string[] property of Verbs which seems to contain the list of permitted values for Verb.

I notice that within the Verbs array there is a value for "Print" and a value for "PrintTo". What's the difference between the two? I tested both and they both seem to cause the file to print to my default printer.

Sonny Boy
  • 7,848
  • 18
  • 76
  • 104

2 Answers2

3

According to this MSDN article, PrintTo is basically present to support drag-and-drop operations for printing (dragging a document over a printer icon, for example). It sounds like it's probably not meant to be used by your code.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
1

The printto verb is normally used when the user drags a file and drops it on a printer shortcut. You need to supply at least two arguments, the first one is the file you want to get printed, the second one is the printer name. Registry entries on my machine use additional arguments but it is quite unclear to me what they may be.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • 1
    For `printto` verb on win3.x only "%3" = driver name, "%4" = port name, not used any more. Would have been useful to specify copies in %3 for instance but alas. – wqw May 21 '12 at 08:32
  • Indeed, this is specified in the article Jon linked to (it is given as an example in the section "Static vs. Dynamic Verbs"). It's a shame there's no organized table with verbs and their provided arguments (although perhaps all of them except printto get only one param, the file name) – Ohad Schneider Jul 21 '13 at 14:17
  • Such a table can't exist. Apps register their own verbs in the registry. Verbs like "open" and "print" are common only by convention, ShellExecuteEx() supports any. The easiest way to see which ones are available for an app is to look in the registry. – Hans Passant Jul 21 '13 at 14:25
  • @HansPassant: Hi, is it possible to pass all the printer setting which captured from a `PrintDialog`? – huMpty duMpty Mar 05 '14 at 14:43