Questions tagged [process.start]

The Start() method on the .NET System.Diagnostics.Process class for starting applications from within a program

See https://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx

516 questions
400
votes
10 answers

Process.start: how to get the output?

I would like to run an external command line program from my Mono/.NET app. For example, I would like to run mencoder. Is it possible: To get the command line shell output, and write it on my text box? To get the numerical value to show a progress…
stighy
  • 7,260
  • 25
  • 97
  • 157
197
votes
15 answers

How do I start a process from C#?

How do I start a process, such as launching a URL when the user clicks a button?
WanKenoobi
62
votes
9 answers

How can I run an EXE program from a Windows Service using C#?

How can I run an EXE program from a Windows Service using C#? This is my code: System.Diagnostics.Process.Start(@"E:\PROJECT XL\INI SQLLOADER\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe"); When I…
xoops
  • 671
  • 1
  • 8
  • 10
50
votes
3 answers

Replacing Process.Start with AppDomains

Background I have a Windows service that uses various third-party DLLs to perform work on PDF files. These operations can use quite a bit of system resources, and occasionally seem to suffer from memory leaks when errors occur. The DLLs are…
MikeWyatt
  • 7,842
  • 10
  • 50
  • 71
45
votes
6 answers

Use Process.Start with parameters AND spaces in path

I've seen similar examples, but can't find something exactly like my problem. I need to run a command like this from C#: C:\FOLDER\folder with spaces\OTHER_FOLDER\executable.exe p1=hardCodedv1 p2=v2 I'm setting v2 at runtime, so I need to be able…
WEFX
  • 8,298
  • 8
  • 66
  • 102
25
votes
3 answers

Process.Start() not starting the .exe file (works when run manually)

I have an .exe file that needs to be run after I create a file. The file is successfully created and I am using the following code to run the .exe file after that: ProcessStartInfo processInfo = new ProcessStartInfo(); processInfo.FileName =…
disasterkid
  • 6,948
  • 25
  • 94
  • 179
24
votes
5 answers

Access is denied exception when using Process.Start() to open folder

I have a winforms application in C# where I have to open a certain Folder. I use System.Diagnostics.Process.Start(pathToFolder); This results in the following exception: System.ComponentModel.Win32Exception (0x80004005): Access is denied at…
IRAndreas
  • 401
  • 1
  • 3
  • 9
23
votes
5 answers

Process.Start(url) broken on Windows 8/Chrome - are there alternatives?

To open a URL from a .NET application, many sites (including on StackOverflow) cite this example: Process.Start("http://www.google.com/"); On Windows 8, this works if Internet Explorer is the default browser. However if Google Chrome is the…
Paul Stovell
  • 32,377
  • 16
  • 80
  • 108
21
votes
1 answer

C# Process Start needs Arguments with double quotes - they disappear

I'm trying to run a cmd line application from c# using Process.Start(ProcessStartInfo); The problem is, the cmd line application is a matlab standalone .exe and has optional arguments meaning that you pass them on the cmd line as such: app.exe…
poncho
  • 1,100
  • 2
  • 15
  • 38
15
votes
3 answers

Process.Start() and PATH environment variable

I have the following trivial C# application that simply attempts to launch "jconsole.exe", which on my machine is located in C:\Programs\jdk16\bin. using System; using System.Diagnostics; namespace dnet { public class dnet { static void Main(…
Reg Domaratzki
  • 895
  • 2
  • 7
  • 11
14
votes
1 answer

Process.Start never returns when UAC denied

I have an updater exe that is meant to close the primary exe, replace it with an updated exe, and then launch that updated exe. When the updater attempts to start the updated exe, if the UAC permissions dialog is denied by the user, the updater will…
14
votes
2 answers

How can I start a new Process and wait until it finishes?

I want to start a program with C# (could use Process.Start()). Then my program should wait until the started program is closed, before it continues. How do I do this?
LostPhysx
  • 3,573
  • 8
  • 43
  • 73
13
votes
3 answers

Application started by Process.Start() isn't getting arguments

Using C#, I am trying to pass command-line arguments to a new process using Process.Start(): string path = @"C:\Demo\Demo.exe"; string arguments = "one two three"; ProcessStartInfo startInfo = new ProcessStartInfo { FileName = path, …
GreenRibbon
  • 299
  • 2
  • 16
12
votes
2 answers

How do I ensure C#'s Process.Start will expand environment variables?

I'm attempting to create a process like so: var psi = new ProcessStartInfo { FileName = @"%red_root%\bin\texturepreviewer.exe", UseShellExecute = true }; var process = Process.Start(psi); process.WaitForExit(); Now the environment variable…
MattN
  • 125
  • 1
  • 5
12
votes
3 answers

Start an external process on mac with c#

I'm successfully using System.Diagnostics.Process.Start() to start my external mono executable on windows. However it fails on mac. I'm not getting any error, simply nothing at all happens. I tried doing it the following…
Ilya Suzdalnitski
  • 52,598
  • 51
  • 134
  • 168
1
2 3
34 35