473,323 Members | 1,560 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,323 software developers and data experts.

Process

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
Nov 19 '05 #1
2 1123
You may set the property

p.StartInfo.WorkingDirectory

to the directory where the config file is.

--
Ahmed Bouagja
Trond wrote:
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


Nov 19 '05 #2
Jepp, that was it. Thanks a lot :-)
Best regards
Trond

<bo*****@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
You may set the property

p.StartInfo.WorkingDirectory

to the directory where the config file is.

--
Ahmed Bouagja
Trond wrote:
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

Nov 19 '05 #3

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

Similar topics

1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
11
by: Mike M | last post by:
Is it possible? In the parent process, I have a socket that binds, listens and then accepts new connections (which creates new sockets in the process). I want to be able to pass some of these new...
6
by: Michael J. Moore | last post by:
Is it the listener process, or some other Oracle process. Also, on a UNIX system, when you do "ps -ef" to see your processes, the PPID points back to a process named "init". Why does the PPID not...
12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
6
by: Dmitri Shvetsov | last post by:
Hi, Can I start an external process from the Web Service? I'm using a code, compiler keeps silence, compiles ok and starts the project. When I trace in Debugger it doesn't start an external...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
5
by: GTS | last post by:
Hi All, I am spawning a process from a service. The spawned process hungs for various reasons, (corrupted data, deadlock). I am expecting the process has to complete the task with in the...
11
by: Jon Davis | last post by:
Does anyone know why using System.Diagnostics.Process to "wrap" a console application does not always transmit the I/O, depending on what processes you're trying to "consume"? PowerShell, for...
4
by: =?Utf-8?B?U3Jhag==?= | last post by:
There is a process A that launches process B as a COM object. If the User tries to end process A, process B should also end. But vice versa is not true. Process A can run independant of process. It...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.