Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. startprocess

startprocess

Scheduled Pinned Locked Moved Windows API
helpquestion
3 Posts 2 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eftekharpour
    wrote on last edited by
    #1

    anybody knows ? help meeeeee..

    L 2 Replies Last reply
    0
    • E eftekharpour

      anybody knows ? help meeeeee..

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Please do not post messages like this. If anyone knows the answer to your question they will provide it in their own time.

      speaking as ...

      1 Reply Last reply
      0
      • E eftekharpour

        anybody knows ? help meeeeee..

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        eftekharpour wrote:

        anybody knows ? help meeeeee..

        Sure. You got to the manual here[^], and then you can read which exceptions the Start method might throw, and why. ..and if you click on the Exception and read it, you'll find a nice exception-handler that gives some more detail;

        try
        {
        System.Diagnostics.Process myProc = new System.Diagnostics.Process();
        myProc.StartInfo.FileName = "c:\nonexist.exe"; //Attempting to start a non-existing executable
        myProc.Start(); //Start the application and assign it to the process component.
        }
        catch(Win32Exception w)
        {
        Console.WriteLine(w.Message);
        Console.WriteLine(w.ErrorCode.ToString());
        Console.WriteLine(w.NativeErrorCode.ToString());
        Console.WriteLine(w.StackTrace);
        Console.WriteLine(w.Source);
        Exception e=w.GetBaseException();
        Console.WriteLine(e.Message);
        }

        In this particular case, I'd guess that Windows can't find the file - probably because it's not in the local path.

        Bastard Programmer from Hell :suss:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups