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
4
votes
2 answers

Mono on OSX, Process.Start sometimes throws native wrapper exception that is unhandleable

So I have a console application running in Mono 3.12.0 on OSX. Occassionally, and I mean, maybe once every 100 or more executions of CleanupPriorToApplicationStart(), I get the stacktrace below and the parent thread that calls the cleanup method…
Richthofen
  • 2,076
  • 19
  • 39
4
votes
2 answers

C# Process.Start Path

I currently have a functioning program that simply launches a separate .exe file by clicking a button. The installer I've created asks where they want to install which by default is in fodler C:\Program Files\PRHA. The code that launches the…
Dylan Banta
  • 165
  • 1
  • 2
  • 17
4
votes
1 answer

Unable to launch shortcut (lnk) files from 32-bit C# application when the full path resolves to a 64-bit directory

I'm trying to launch programs in the Start Menu from a C# application, and nearly all of the items in the Start Menu are shortcut (lnk) files. When using Process.Start to launch these files, I found that I was getting "The system cannot find the…
andrewl85
  • 199
  • 1
  • 4
  • 11
4
votes
1 answer

Is it possible to open regedit and navigate to straight to a specific key using process.start?

I'm making a small tool that can write a key in registry, and a tiny part of it just for convenience would be to navigate to that key instantly with the click of a button. I know how to open regedit.exe already but is there a way to instantly…
WolfyD
  • 865
  • 3
  • 14
  • 29
4
votes
1 answer

Can I open Notepad.exe from C# with "Find" option opened?

I created a Window form C# application which opens a Notepad.exe using command: System.Diagnostics.Process.Start("notepad.exe", w_file); But I want to open the Notepad with option "Edit-Find" and put some value into the "Find" field. Is it…
Zalek Bloom
  • 551
  • 6
  • 13
4
votes
6 answers

How do I execute a DOS SET command from C# and have the variable persist after the exe closes?

I have a C# console executable started within a DOS command process. I need to be able to execute DOS commands from the C# executable (specifically I need to be able to SET variables) and have the variables persist such that the rest of the DOS…
Mohammed
  • 198
  • 1
  • 10
3
votes
1 answer

Fail to open excel file using Process.Start() in .Net4.0

Recently an old project of .Net 1.1 is migrating to .Net4.0. The project is using the following method to open excel file: Process process = new Process(); try { process.StartInfo.FileName = marco_file; …
macemers
  • 2,194
  • 6
  • 38
  • 55
3
votes
4 answers

How do you open a local html file in a web browser when the path contains an url fragment

I am trying to open a web browser via the following methods. However, when the browser opens the url / file path, the fragment piece gets mangled (from "#anchorName" to "%23anchorName") which does not seem to get processed. So basically, the file…
user248450
  • 81
  • 1
  • 1
  • 5
3
votes
1 answer

C# - Process.Start() The Operation was cancelled by the user

Pardon my lack of any proper formatting here, but I desperately need a solution to this one problem I hadn't even known existed up until this point. While running Process.Start(); I run in to this problem: Unhandled Exception:…
Metalhead
  • 53
  • 7
3
votes
3 answers

Open a file in C# using Process.Start

I am writing a program that monitors a folder and lets you know when a file is created. I'm struggling to open the file when the user clicks ok. Please could I have advice on how to get the Process.Start() to work, i'm trying to get the file…
Matt
  • 187
  • 1
  • 4
  • 13
3
votes
1 answer

Hide controlbox on Process.Start() cmd window

I am using process.Start(); to start a batch file. The CMD windows appears fine and works perfectly. How can I disable the controlbox (minimize, maximize, close) on the upper right of the cmd window progmatically. I wish for the CMD window to be…
bulltorious
  • 7,769
  • 4
  • 49
  • 78
3
votes
1 answer

Process.Start cannot find the executable

I want to change the BCD from my .NET application. To do so, I've created this little snippet: static void RunBcdEdit() { Process process = new Process(); process.StartInfo.FileName = "c:\\Windows\\System32\\bcdedit.exe"; …
SuperJMN
  • 13,110
  • 16
  • 86
  • 185
3
votes
6 answers

C# cannot find file specified

Hi I am trying to create a app that uses the msg.exe to send messages over a network. When i execute msg from cmd everything works fine, but when i open cmd with the form i am unable to, went to the system32 folder with cmd and the file is not shown…
Splendid
  • 53
  • 1
  • 6
3
votes
2 answers

Adobe Reader process fails when starting second instance

In our C# WinForms application, we generate PDF files and launch Adobe Reader (or whatever the default system .pdf handler is) via the Process class. Since our PDF files can be large (approx 200K), we handle the Exited event to then clean up the…
Reddog
  • 15,219
  • 3
  • 51
  • 63
3
votes
1 answer

Can't start powerpoint from start menu shortcut in c#

I'm attempting to start a program based on a start menu shortcut. In particular, I'm trying to launch powerpoint based on its start menu shortcut. To accomplish this, I am using the IWshRuntimeLibrary. static void Main(string[] args) { string…