473,378 Members | 1,495 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,378 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 5097
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: ...
1
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
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.