Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8861083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:24:42+00:00 2026-06-14T15:24:42+00:00

Edit: I didn’t mean to pinhole this question to a specific executable. I want

  • 0

Edit: I didn’t mean to pinhole this question to a specific executable. I want this to work for any executable. If I was to type in the FileName into a run dialog, and the result is the “Windows cannot find …” dialog, then I dont want to Start that process. Updated below…

I would like to execute ‘an executable’ in my program, but if the user doesn’t have the executable installed, I want to run another process. How can I check BEFORE actually starting the visio process that visio is installed on the system? I do not want a popup “Windows cannot find “executable”…

Here’s my code. But this does give the “Windows cannot find “executable”..” error pop-up.

System.Diagnostics.Process myProc = new System.Diagnostics.Process();
myProc.StartInfo.FileName = "an executable.exe";
myProc.StartInfo.Arguments = "MyDoc.txt";
myProc.StartInfo.WorkingDirectory = "C:\MyFolder";

try
{
    if( !myProc.Start() )
    {
        myProc.StartInfo.FileName = "another process.exe";
        myProc.Start();
    }
}
catch (Exception ex)
{
    ...
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:24:44+00:00Added an answer on June 14, 2026 at 3:24 pm

    tldr; Something else causes the “Windows cannot find ..” dialog – what does the Exception handling code look like?

    On a system without Visio the code

    System.Diagnostics.Process myProc = new System.Diagnostics.Process();
    myProc.StartInfo.FileName = "visio.exe";
    myProc.StartInfo.Arguments = "MyVisioDoc.vsd";
    myProc.StartInfo.WorkingDirectory = "C:\\MyVisioFolder"; // fixed literal
    myProc.Start();
    

    results in the helpful Exception being thrown

    Win32Exception: The system cannot find the file specified

    While this will result in Visio running if it is found, if Visio isn’t found, there is no inherent reason why a dialog message box is shown. That’s not normal behavior.

    Now, if launching via MyVisioDoc.vsd directly (e.g. using the Open Verb) then yes, that is passed off to the windows system and may, if .vsd files are associated with a missing Visio application, result in such a dialog. However, this a different scenario than that presented in this post.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: This didn't work because I had: class Animal { ... } class Horse
edit: I completely rewrote the question as the original one didn't clearly explain my
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
EDIT: I didn't post my XML for this dialog. <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
Yesterday the application was working normally, and i didn't edit my codes. But now
Edit Since there were many downvotes and people who didn't understand what I'm asking
Edit (updated question) I have a simple C program: // it is not important
EDIT : It turned out that this can only be done through an external
* Edit * I didn't know about 'Add Dynamic Property' feature of Idea, that
I'd like to add some simple text into some files. Specifically, I do this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.