System.Diagnostics.Process.Start and launching notepad

  • Thread starter Thread starter andreas
  • Start date Start date
A

andreas

hi,

In windows xp in the start launch menu when i put
notepad "c:\test.txt"
i get notepad with test.txt in it.

in vb.net when i state
system.diagnostics.process.start("notepad.exe"
i get notepad
but
system.diagnostics.process.start("notepad.exe c:\test.txt") don't work
can i get the file test.txt in notepad ?
Thanks for any response
 
Hi,

in this code:
system.diagnostics.process.start("notepad.exe c:\test.txt")

I think that you want to open c:\test.txt in notepad.exe.

process.start has a constructor thru which you can pass arguments
to starting process.

try this:
System.Diagnostics.Process.Start("notepad.exe", "c:\test.txt")
 
Hi Adreas,

I hope that this sample helps?

Cor

\\\
Public Class Main
Public Shared Sub Main()
Dim p As New Process
p.StartInfo.UseShellExecute = True
p.StartInfo.Arguments = "c:\text.txt"
p.StartInfo.FileName = "notepad.exe"
p.Start()
End Sub
End Class
///
 
Back
Top