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 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

Ask A Question

Stats

  • Questions 377k
  • Answers 377k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should modify the datasource. Delete the item from the… May 14, 2026 at 9:03 pm
  • Editorial Team
    Editorial Team added an answer Link You need to run a repair on the “Microsoft… May 14, 2026 at 9:03 pm
  • Editorial Team
    Editorial Team added an answer Just start up SSH tunnel and use the local port… May 14, 2026 at 9:03 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.