473,785 Members | 3,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5139
On Jun 13, 1:50 pm, "Kerem Gümrükcü" <kareem...@hotm ail.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.

ProcessStartInf o p = new ProcessStartInf o();
Environment.Get EnvironmentVari ables()
p.StartInfo.Env ironmentVariabl es.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*******@hotm ail.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 ProcessStartInf o.UseShellExecu te 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*******@hotm ail.comschrieb im Newsbeitrag
news:u7******** ******@TK2MSFTN GP05.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
1051
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 process of it's UID. 3. take more disk space, by writing big files 4. and lot more one could think of ..
0
1353
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 have a batch file with the exact same code and it does not work. Can anyone help? This is the code: Process p1 = new Process(); p1.StartInfo.FileName = programName2; p1.StartInfo.Arguments = arg2; p1.StartInfo.RedirectStandardOutput = true;
8
36463
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 seems to work. But I have no clue how to pause/suspend the process. As far as I can see the Process class doesn't offer anything for this. So it's probably the thread the process is running on that should be suspended or put to sleep. But just...
4
1762
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
13746
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 until it's finished. If the command didn't terminate within the timeout, the command is killed. (Ex. 2) - launch the command and continue your processing after the command has been started remotely (Ex. 3).
10
3075
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 correct that os.environ contains the PATH environment variable? 2) are there other ways to obtain the PATH environment variable? if so,
6
3545
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 the MIPS assembling language (http://www.cs.wisc.edu/~larus/spim.html). I know that maybe that particular file has something strange, but I thought someone could give me some advice.
5
551
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 process in hanging and display the process information on screen with option to kill it or allow the execution. I shall be thankful to you if you can help me in this.
3
1453
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 need an execution timer and timeout control (to kill the apps in certain situations). Looking at google, I found the Pexpect package, but I m a little bit lost in using it. So, any good suggetions?
3
2008
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: smitty@localhost ~/proj/mddl4/test $ ./inputs.py {'source_db': '/home/sweet/home.db'} smitty@localhost ~/proj/mddl4/test $ source_db="test_env" ./inputs.py {'source_db': 'test_env'} smitty@localhost ~/proj/mddl4/test $ ./inputs.py -f "test_cli"
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.