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 9135141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:47:09+00:00 2026-06-17T08:47:09+00:00

I have an application that runs in any one OS (either win7(x86) or win

  • 0

I have an application that runs in any one OS (either win7(x86) or win xp).

My project is designed in Visual studio 2010, I am using .Net 4.0.

Earlier the project’s “working directory” in the properties was specified for win 7 but when i build my project it said unable to locate the working directory(C:\Program Files(x86)\app)

I now changed my working to directory as C:\Program Files\app. My application acts as a plugin to MS excel 2003. And now i am able to run it.

so how can i make my application run in both win xp and win 7?

I am using WinForms .net 4.0 c#.

 private void MyMenuItem_Click(object sender, EventArgs e)
    {
        MyMenuItem.Enabled = false;   
        string installPath;
        string helpFileName;
        string appName;


installPath =   Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
        appName = "\\MyApp\\";   



        if (System.IO.File.Exists(installPath + appName+ helpFileName))
        {


System.Windows.Forms.Help.ShowHelp(new System.Windows.Forms.Control()                              installPath + appName + helpFileName, 
                   System.Windows.Forms.HelpNavigator.TableOfContents);
        }



    }
  • 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-17T08:47:09+00:00Added an answer on June 17, 2026 at 8:47 am

    Have a look at the Environment.SpecialFolder enumeration

    In System.IO there’s a static class called Path with some very nice stuff on

    Struggled a bit because I can’t see where you are getting helpFileName from…

    private void MyMenuItem_Click(object sender, EventArgs e)
    {
       MyMenuItem.Enabled = false;   
       String helpFileName = "IDoNotKnow.ext";
       string fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),Path.Combine("MyApp",helpfileName));
       if (System.IO.File.Exists(fileName))
       {
          System.Windows.Forms.Help.ShowHelp(new System.Windows.Forms.Control(),fileName,System.Windows.Forms.HelpNavigator.TableOfContents);
       }
    }
    

    One of the things Path.Combine does for you is you don’t have to worry about the backslashes. If there’s a trailing one on an argument it uses it, if there isn’t it pops it in. Hides a lot of mess that, on occasion.

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

Sidebar

Related Questions

I have written an ASP.NET MVC application that runs inside an IFrame. When one
I have a web application that runs multiple websites from one codebase. I have
I have developed one web application that runs under all browser via applet (core
i have an application project that both managed and unmanaged code runs and i
I have a application that runs very well on JBoss using JSF 2. I
I have an application that runs on a shared hosting website - it is
I have an application that runs through the rounds in a tournament, and I
I have an application that runs on a client's server built on a SQL
I have an application that runs the a command as below: <command> <switches> >&
I use node.js and socket.io. I have an application that runs on the IP

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.