473,461 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

System.Diagnostics.Process.Start and launching notepad

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

Nov 20 '05 #1
2 15442
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")

--
Hope this helps,
Zeeshan Mustafa, MCSD
"andreas" <an*****@pandora.be> wrote in message
news:PH**********************@phobos.telenet-ops.be...
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



Nov 20 '05 #2
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
///
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


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: T | last post by:
How do you catch the "Exited" event when a process is terminated. In the following code sample the "myProcess_Exited" event is never called. Any help would be appreciated. using System; using...
4
by: choihead | last post by:
Hi All, How can i excuete a bat file by c#? I used System.Diagnostics.Process.Start("../stage.bat"); but it cannot find the file, is this the correct method to call the bat file? thx...
6
by: gizmo | last post by:
I have a requirement to initiate more than one instance of an application using the filenames. (the example below will start two instances of MS Word). My problem is that I need to kill each...
1
by: Heiko Besemann | last post by:
Dear group, I created an aspx page using System.Diagnostics.Process() to launch "tracert" from shell and redirect output to Response.Output which prints it as text/plain into my browsers window....
0
by: JH | last post by:
I am trying to run an INF file or alternatively I have a CMD file. I have tried with an EXE file using the following code System.Diagnostics.Process.Start(directoryName & "\" & "notepad.exe")...
2
by: Jm | last post by:
Hi all Im using System.Diagnostics.Process.Start to launch external apps from my app but the working directory seems to point to where my app is located. How can i get around this and basically...
11
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very...
0
by: Daniel | last post by:
System.Diagnostics.Process.Start fails on windows server 2003 the process returns process.ExitCode == 0 but executing any process with System.Diagnostics.Process.Start on windows xp works fine....
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.