473,320 Members | 1,952 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,320 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 5088
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sridhar R | last post by:
I like to execute programs from python. ... not by using os.system .. bcoz .. 1. the process could easily eat up the CPU 2. the process could use signal system call to even kill all other...
0
by: Jorge | last post by:
I'm writing an application that uses system.diagnostics to run an executable that will allow me to create a map. However the program fails to start or if its start it is not creating any output. I...
8
by: Wim | last post by:
My GUI application starts a process (a console program) when the user hits Play. I would like to add an option to pause that process. The code I've added to detect if the user hit pause/unpause...
4
by: Federico G. Babelis | last post by:
Hi All: I need to gather the runtime in format "HH:mm:ss" of certain processes from its start to its end, any ideas ? thanks, Federico
0
by: Patrick A. | last post by:
Dll written in VB.NET 2003 to start a command remotely. You can : - launch the command and wait until it's finished. (Ex. 1) - launch the command providing a timeout in seconds, it will wait...
10
by: mirandacascade | last post by:
O/S: Win2K Vsn of Python:2.4 Based on a search of other posts in this group, it appears as though os.environ is one way to obtain the PATH environment variable. My questions: 1) is it...
6
by: Leonel Galán | last post by:
When doing Process.Start(), I get "The parameter is invalid" Win32Exception when opening a particular exe. This exe works good in Windows (cmd.exe). The exe is "SPIM.exe" as the Simulator for...
5
by: Alok Gupta | last post by:
Hi There, I want to develop a small software which can control process execution as AntiVirus does. That is as soon as any process start execution/ started /executed , my software will put this...
3
by: Wesley Mesquita | last post by:
Hi all, I am trying to create a test environment to a couple C applications (simple UDP and TCP server/clients), so I want to write this in python and I m looking for ways to do it. Basically I...
3
by: smitty1e | last post by:
Just a fun exercise to unify some of the major input methods for a script into a single dictionary. Here is the output, given a gr.conf file in the same directory with the contents stated below: ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
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...
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: 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...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.