Results 1 to 10 of 10

Thread: [2005] Launch executable App from code

  1. #1

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    Cool [2005] Launch executable App from code

    plz, hw can i launch notepad.exe or mspaint(or any executable program) from code in .NET
    Nobody is smarter than all of us!

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2005] Launch executable App from code

    using the process class.

    VB.Net Code:
    1. Process.Start("notepad")
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    Re: [2005] Launch executable App from code

    Quote Originally Posted by Atheist
    using the process class.

    VB.Net Code:
    1. Process.Start("notepad")
    what if its my own app?will i still use Start('...???")? after i import d required namespace?
    Nobody is smarter than all of us!

  4. #4
    Hyperactive Member Troy Lundin's Avatar
    Join Date
    May 2006
    Posts
    489

    Re: [2005] Launch executable App from code

    You would use
    vb.net Code:
    1. Process.Start(myAppPath)
    Prefix has no suffix, but suffix has a prefix.

  5. #5
    Junior Member
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    24

    Re: [2005] Launch executable App from code

    This one is if you want command buttons to start executable files....
    vb Code:
    1. Shell ("C:\Program\something\File.exe")

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Launch executable App from code

    Quote Originally Posted by marabon
    This one is if you want command buttons to start executable files....
    vb Code:
    1. Shell ("C:\Program\something\File.exe")

    shell is really only in the language for backwards compatibility from VB6.

    I can't think of any valid reason to use SHELL over Process.Start() in .NET

  7. #7
    Junior Member
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    24

    Re: [2005] Launch executable App from code

    Ok, but it still works......

  8. #8
    Hyperactive Member Troy Lundin's Avatar
    Join Date
    May 2006
    Posts
    489

    Re: [2005] Launch executable App from code

    Ok, but it still works......
    True, but it may be omitted from future versions.
    Prefix has no suffix, but suffix has a prefix.

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Launch executable App from code

    Quote Originally Posted by marabon
    Ok, but it still works......
    yeah it works, but all it does is launch the specified file and all it gives you in return is the processID.

    When you use the process class, you can do things like tell it to redirect its output to a stream in your app (great when executing command line apps), you can track the process to see if its exited, you can kill the process, you can tell it to create no window for the process, you can get the main window handle of the process, etc...

  10. #10

    Thread Starter
    Hyperactive Member oyad's Avatar
    Join Date
    Feb 2003
    Location
    PhoxWare MicroSystems
    Posts
    463

    Re: [2005] Launch executable App from code

    plz, whats d difference btw windows command prompt and vs.net/sdk command prompt?can aspnet_regiis b run with Process.start(...) in code to grant asp.net d the required permission account(coz when opening my web app, it says:asp.net blablabla account does not have write access to so so so...But when i added asp.net account to members of Windows administrator account, i don't get dat problem.i did it manually)
    Nobody is smarter than all of us!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width