Q:

.net's process class does not send my file to printer, but does not return an error

I am trying to programatically print a file using the Process and ProcessInfo classes from the .NET 4.0 library following these instructions from Microsoft. http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.verbs(v=vs.100).aspx
I have set up a network printer at \\server\printername and am able to print a test page at that location. 
But when I run this code in visual studio, it does not print and does not return any error saying there is a problem: 
    Dim proc As New Process
    Dim startInfo As New ProcessStartInfo(filename)
    proc.StartInfo.FileName = filename
    proc.StartInfo.Verb = "printto"
    startInfo.Arguments = "\\server\printername"
    proc.StartInfo = startInfo
    proc.Start()

As far as I can tell, all this code does is open the txt file in a new window.
If I try to run the process from the CMD shell, I get the following error: 
print /d:\\servername\printername C:\path\filename.txt
unable to initialize device \\servername\printername

What steps can I take to de-bug this problem?

A:

You're overwriting proc.StartInfo after setting the properties.
Try:
Dim proc As New Process
Dim startInfo As New ProcessStartInfo(filename)
startInfo.FileName = filename
startInfo.Verb = "printto"
startInfo.Arguments = "\\server\printername"
proc.StartInfo = startInfo
proc.Start()

