System.Diagnostics.Process.Start() 
Author Message
 System.Diagnostics.Process.Start()

Hi there,

System.Diagnostics.Process.Start() works fine for e.g. opening a *.doc file
with Word directly. I want to use the same function to print a file with the
corresponding application, however:

System.Diagnostics.Process.Start("print:file.doc") won't work. Is there
another way without falling back to the "non-dotNET" ShellExecute API?

Thanks,

--
SLE



Tue, 26 Apr 2005 16:45:19 GMT  
 System.Diagnostics.Process.Start()
Dim mos As System.Management.ManagementObjectSearcher

Dim moc As System.Management.ManagementObjectCollection

Dim mo As System.Management.ManagementObject

Dim prop As System.Management.PropertyData

Dim FSO As Object

Dim txtstream As Object

Dim MyString As String

mos = New System.Management.ManagementObjectSearcher("SELECT * FROM
Win32_Process")

You can start a process using it.


Quote:
> Hi there,

> System.Diagnostics.Process.Start() works fine for e.g. opening a *.doc
file
> with Word directly. I want to use the same function to print a file with
the
> corresponding application, however:

> System.Diagnostics.Process.Start("print:file.doc") won't work. Is there
> another way without falling back to the "non-dotNET" ShellExecute API?

> Thanks,

> --
> SLE



Tue, 26 Apr 2005 23:22:13 GMT  
 System.Diagnostics.Process.Start()


Quote:
> Hi there,

> System.Diagnostics.Process.Start() works fine for e.g. opening a *.doc
file
> with Word directly. I want to use the same function to print a file with
the
> corresponding application, however:

> System.Diagnostics.Process.Start("print:file.doc") won't work. Is there
> another way without falling back to the "non-dotNET" ShellExecute API?

FYI:

Dim strFile As String = "c:\test.doc"
Dim objProcess As New System.Diagnostics.ProcessStartInfo()

With objProcess
    .FileName = strFile
    .Verb = "print"
End With

System.Diagnostics.Process.Start(objProcess)

--
SLE



Sat, 30 Apr 2005 16:05:13 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How can I set the text in the titlebar of System.Diagnostics.Process.Start

2. Invoking System.Diagnostics.Process.Start

3. System.Diagnostics.Process.Start

4. System.Diagnostics.Process.Exited event not firing

5. Using the System.Diagnostic.Process class

6. System.Diagnostics.Process

7. System.Diagnostics.Process class HELP PLEASE

8. System.Diagnostics.Process.Start("C:\")

9. simple questions (CDONTS/carCount/scriptname/sort)

10. System.Runtime.InteropServices.VTableCallsNotSupportedException

11. System.Diagnostics.start on Windows 2000

12. What's wrong??? [System.Diagnostics]

 

 
Powered by phpBB® Forum Software