CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008

    Arrow How do I launch app

    I am writing a configurable launcher for custom World of warcraft servers. The problem I am having is when I run the app I get an exception. The exception I get is it can't find the program. I am using the app settings object in c# i.e. settings1.settings. The data I put in stays put and is being called to the main form.

     string InstallPath = Properties.Settings1.Default.path2;
                Process.Start(InstallPath + "WoW.exe");
    When it runs Process.Start it throws the file not found exception.

    I have tried putting the data in the settings multiple ways i.e. c:\*** c:\\***\\ \\***\\ just not sure what I need to do. Any help would be appreciated.

    Here is the code i use to save the data to the settings

     private void btnSave_Click(object sender, EventArgs e)
                Properties.Settings1.Default.path1 = txtWoW434.ToString();
                Properties.Settings1.Default.path2 = txtWoW510.ToString();
    Last edited by firedraken; February 25th, 2013 at 10:50 PM.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004

    Re: How do I launch app

    Have you tried debugging the program?

    One thing that would help with this is to form the full path to the exe you are trying to launch.

    So instead of

    string installPath = Properties.Settings1.Default.path2;
    Process.Start(installPath + "WoW.exe");

    string installPath = Properties.Settings1.Default.path2;
    var fullPath = Path.Concat(installPath, "wow.exe");
    if( !File.Exists(fullPath) )

    To debug, click on the if( !File.Exists(fullPath) ) line with the mouse and press F9 to set a breakpoint.
    Then press F5 to start debugging. When the program stops on that line, hover the mouse over the fullPath variable.
    Does it look like what is expected? Keep in mind on windows, a file path will look something like
    C:\my program folder\sub folder\wow.exe

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.