Process

T

Trond

I am trying to start a console program from an event in a ASP.NET page. In
the folder where the EXE is there is a config file. Here is some code i
wrote that should start the exe file:

----------------------------------------------------------------

Process p = new Process();

p.StartInfo.FileName = @"C:\Manager\Manager.exe";

p.StartInfo.Arguments = @"/c dir C:\Manager";

p.StartInfo.UseShellExecute = false;

p.StartInfo.CreateNoWindow = true;

p.Start();

p.WaitForExit(3000);

----------------------------------------------------------------

In event viewer i get error that indicates that the config file can not be
found in C:\WINDOWS\SYSTEM32 folder?

File not found!: C:\WINDOWS\system32\Manager.config:
System.IO.FileNotFoundException: Could not find file
"C:\WINDOWS\system32\Manager.config".

The Manager.exe file is starting up some work where it reads from a database
and append a message to a messagequeue. It needs some values set in config
file. I am a lil stuck here so i am wondering if anyone in here has a
solution for this one :) The config file is in the same folder as the exe.
(C:\Manager)

Best regards
Trond
 
B

bouagja

You may set the property

p.StartInfo.WorkingDirectory

to the directory where the config file is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top