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

  • Home
  • SEARCH
  • 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 622277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:58:03+00:00 2026-05-13T18:58:03+00:00

I am using a third party software tool (command line tool) to merge PDF

  • 0

I am using a third party software tool (command line tool) to merge PDF files together. Using C# I am attempting to use System.Diagnostics.Process to run the executable but I am coming up with a few errors depending on the parameter setup.

  • If UseShellExecute = true and RedirectStandardOutput = true I get:
    • The Process object must have the UseShellExecute property set to false in order to redirect IO streams.
  • If UseShellExecute = true and RedirectStandardOutput = false I get:
    • The system cannot find the file specified
  • If useShellExecute = false and RedirectStandardOutput = true I get:
    • The system cannot find the file specified
  • If UseShellExecute = false and RedirectStandardOutput = false I get:
    • The system cannot find the file specified

The code that is running is the following:

Process p = new Process();

p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = false;
p.StartInfo.WorkingDirectory = "C:\\Program Files (x86)\\VeryPDF PDF Split-Merge v3.0";
p.StartInfo.FileName = "pdfpg.exe " + strFileNames.Trim() + " " 
                       + D2P_Folder_Converted + "\\" + strOutputFileName;
p.Start();
p.WaitForExit();
p.Close();
p.Dispose();

Can someone help me get around this issue, please?

  • 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-05-13T18:58:03+00:00Added an answer on May 13, 2026 at 6:58 pm

    Arguments shouldn’t be passed in the FileName property. You should use the Arguments property for this:

    p.StartInfo.Arguments = string.Format(
        "{0} {1}", 
        strFileNames.Trim(), 
        Path.Combine(D2P_Folder_Converted, strOutputFileName)
    );
    p.StartInfo.WorkingDirectory = Path.Combine(GetProgramFilesX86(), "VeryPDF PDF Split-Merge v3.0");
    p.StartInfo.FileName = "pdfpg.exe";
    

    where the GetProgramFilesX86 function is could be defined like so:

    static string GetProgramFilesX86()
    {
        var processorArchitecture = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432");
        if(IntPtr.Size == sizeof(long) || !string.IsNullOrEmpty(processorArchitecture))
        {
            return Environment.GetEnvironmentVariable("ProgramFiles(x86)");
        }
        return Environment.GetEnvironmentVariable("ProgramFiles");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I detect keyboard event in C language without using third party libraries?
Without using any third party program to do this (i.e. without VMware ThinApp, U3
We're using a third-party middleware product that allows us to write code in an
I'm using a third-party library that returns XML that is not valid, because it
I am using a third party application and would like to change one of
I'm using a third-party library which accesses fonts through the GraphicsEnvironment: getAllFonts() call. This
I am using a third-party DLL. For some particular cases, a function in the
I am using a third-party application, and making a call to create an instance
Anyone know how to do this without using a third party program? If there
How would you reccommend handling RSS Feeds in ASP.NET MVC? Using a third party

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.