471,349 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Process.Start(...) and Execution Environment,...

Hi,

i wonder that the Process.Start(...) needs full path to the
executable to start it, even the executable is listed in the
PATH Variable and can be launched from any console
on my system. Is it possible to do the same from Process.Start(...)?
How can i set the Process Executon Environment for the
Process, so that the call to Start(...) will resolve the path to the
Exe from the PATH Env. and run it. Is this possible...? Maybe
i miss something here,...
Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Jun 27 '08 #1
4 4913
On Jun 13, 1:50 pm, "Kerem Gümrükcü" <kareem...@hotmail.comwrote:
Hi,

i wonder that the Process.Start(...) needs full path to the
executable to start it, even the executable is listed in the
PATH Variable and can be launched from any console
on my system. Is it possible to do the same from Process.Start(...)?
How can i set the Process Executon Environment for the
Process, so that the call to Start(...) will resolve the path to the
Exe from the PATH Env. and run it. Is this possible...? Maybe
i miss something here,...

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space:http://kerem-g.spaces.live.com/
Latest Open-Source Projects:http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
You could use the following functions. Never tried it myself.

ProcessStartInfo p = new ProcessStartInfo();
Environment.GetEnvironmentVariables()
p.StartInfo.EnvironmentVariables.Add()
Jun 27 '08 #2
Just make sure the path your file is included in the Windows' path.

To set the Windows' path, go into My Computer Properties.

"Kerem Gümrükcü" wrote:
Hi,

i wonder that the Process.Start(...) needs full path to the
executable to start it, even the executable is listed in the
PATH Variable and can be launched from any console
on my system. Is it possible to do the same from Process.Start(...)?
How can i set the Process Executon Environment for the
Process, so that the call to Start(...) will resolve the path to the
Exe from the PATH Env. and run it. Is this possible...? Maybe
i miss something here,...
Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Jun 27 '08 #3
On Fri, 13 Jun 2008 10:50:01 -0700, Kerem Gümrükcü <ka*******@hotmail.com>
wrote:
Hi,

i wonder that the Process.Start(...) needs full path to the
executable to start it, even the executable is listed in the
PATH Variable and can be launched from any console
on my system. Is it possible to do the same from Process.Start(..)?
I don't have a convenient way to test this myself right now, but you could
try just setting ProcessStartInfo.UseShellExecute to "false".

That property indicates to the Process class whether it should go through
the Windows shell logic, or just treat the process as a normal
executable. While the main difference is whether you can use the Process
class to open documents or not, I think it's possible (likely even) that
if you set the property to false, the normal path search would happen for
starting an executable.

Pete
Jun 27 '08 #4
Thanks to all repliers. It was a more detailed Problem
with Impersonation and Pinvoke. It has been solved.

Thanks to all replies,...
Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"Kerem Gümrükcü" <ka*******@hotmail.comschrieb im Newsbeitrag
news:u7**************@TK2MSFTNGP05.phx.gbl...
Hi,

i wonder that the Process.Start(...) needs full path to the
executable to start it, even the executable is listed in the
PATH Variable and can be launched from any console
on my system. Is it possible to do the same from Process.Start(...)?
How can i set the Process Executon Environment for the
Process, so that the call to Start(...) will resolve the path to the
Exe from the PATH Env. and run it. Is this possible...? Maybe
i miss something here,...
Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sridhar R | last post: by
reply views Thread by Jorge | last post: by
8 posts views Thread by Wim | last post: by
4 posts views Thread by Federico G. Babelis | last post: by
reply views Thread by Patrick A. | last post: by
10 posts views Thread by mirandacascade | last post: by
6 posts views Thread by Leonel Galán | last post: by
5 posts views Thread by Alok Gupta | last post: by
3 posts views Thread by Wesley Mesquita | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.