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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kerem Gümrükcü

    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."


  • parez

    #2
    Re: Process.Start(. ..) and Execution Environment,...

    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()

    Comment

    • =?Utf-8?B?anAybXNmdA==?=

      #3
      RE: Process.Start(. ..) and Execution Environment,...

      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."
      >
      >
      >

      Comment

      • Peter Duniho

        #4
        Re: Process.Start(. ..) and Execution Environment,...

        On Fri, 13 Jun 2008 10:50:01 -0700, Kerem Gümrükcü <kareem114@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

        Comment

        • Kerem Gümrükcü

          #5
          Re: Process.Start(. ..) and Execution Environment,...

          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ü" <kareem114@hotm ail.comschrieb im Newsbeitrag
          news:u7srr3XzIH A.3680@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."
          >

          Comment

          Working...