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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:33:14+00:00 2026-06-09T01:33:14+00:00

How do I specify in C# where to install a specific program? I tried

  • 0

How do I specify in C# where to install a specific program? I tried using .WorkingDirectory but it didn’t work. I want to install the Notepad++ installer inside the NotepadFolder in Desktop, how do I do that?

    static void LaunchInstaller()
    {
        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.FileName = @"C:\Users\UserOne\Downloads\npp.6.1.5.Installer.exe";
        startInfo.WorkingDirectory = @"C:\Users\UserOne\Desktop\NotepadFolder";
        //The line above doesn't work. Notepad++ still installs to its current directory, in ProgramFiles
        startInfo.Arguments = "/S";
        Process.Start(startInfo);
    }

I saw the code below at dotnetperls.com. They didn’t specify the use of the two strings and its arguments so I’m confuse right now:

static void LaunchCommandLineApp()
{
const string ex1 = "C:\\";
const string ex2 = "C:\\Dir";

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = "dcm2jpg.exe";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = "-f j -o \"" + ex1 + "\" -z 1.0 -s y " + ex2;

try
{
    Process exeProcess = Process.Start(startInfo)
    {
    exeProcess.WaitForExit();
    }
}
catch{}
}
  • 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-09T01:33:15+00:00Added an answer on June 9, 2026 at 1:33 am

    Woohoo! Thank you for spenders link, my code works! You just have to add /D=your installation directory in the Arguments.. Here’s my updated code:

        static void LaunchInstaller()
        {
            const string installdir = @"C:\Users\UserOne\Desktop\NotepadFolder";
    
            ProcessStartInfo startInfo = new ProcessStartInfo();
            startInfo.FileName = @"C:\Users\UserOne\Downloads\npp.6.1.5.Installer.exe";
            startInfo.Arguments = "/S /D=" + installdir; //My new code
            Process.Start(startInfo);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to specify a build action, for example install using Xcode GUI?
I'm trying to build a Windows installer using Nullsoft Install System that requires installation
I want to install a gem via gem install , but I need it
Where do I want to install Nginx when I am using RVM. It defaults
How do you specify a redirect URL for the adobe flash express install? I'm
I would like to specify that I want FEATURE_INDETERMINATE_PROGRESS for my Activity . It
I want to compile/install a Perl module that depends on a library that is
I have been mocking out some seam components using the following signature: @Name(myService) @Install(debug
if i want to install a MSI, created by Visual Studio 2005, via Active
I am using gradle as project dependency manager but since I like netbeans better

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.