473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 15440
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.