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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:44:13+00:00 2026-06-18T00:44:13+00:00

Program A(cmd.exe \C) (Takes 1 argument) Program B: (Takes 1 or more arguments) C1,C2,C3,

  • 0

Program A(cmd.exe \C) (Takes 1 argument)

Program B: (Takes 1 or more arguments)

C1,C2,C3, … : A list of agruments

If I type A B C1 C2 C3 in cmd prompt,
The desired interpretation is

A (B (C1 C2 C3)) (C is the arguments to B, B is the argument to A)

But NOT AS A (B) (C1) (C2) (C3) (B,C1,C2, C3, …. are arguments to A)

How should I escape / redirect/pipe in cmd prompt?

Thanks in advance

  • 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-18T00:44:14+00:00Added an answer on June 18, 2026 at 12:44 am

    According to Microsoft’s documentation, you can use the | operator for pipes.

    And you will need to rewrite your command as:

    B C1 C2 C3 | A
    

    Hope this helps.


    UPDATE

    since you updated your question, I guess you are trying to do something like:

    cmd.exe /C B C1 C2 C3
    

    you can escape special characters with ^

    or try to quote the string like this:

    cmd.exe /C "B C1 C2 C3"
    

    UPDATE 2

    If you are having problem with cmd.exe /C and quotes (e.g. B, C1, C2, C3 contains space), you should enclose the whole command with another pair of quotes

    cmd.exe /C ""B" "C1" "C2" "C3""
    

    FYI, in the Processing quotation marks section in Microsoft’s documentation on cmd.exe:

    If you specify /c or /k, cmd processes the remainder of string and
    quotation marks are preserved only if all of the following conditions
    are met:

    • You do not use /s.
    • You use exactly one set of quotation marks.
    • You do not use any special characters within the quotation marks (for example: &<>( ) @ ^ |).
    • You use one or more white-space characters within the quotation marks.
    • The string within quotation marks is the name of an executable file.

    If the previous conditions are not met, string is processed by
    examining the first character to verify whether or not it is an
    opening quotation mark. If the first character is an opening quotation
    mark, it is stripped along with the closing quotation mark. Any text
    following the closing quotation marks is preserved.

    You may want to read Syntax : Escape Characters, Delimiters and Quotes too:

    To launch a batch script with spaces in the Program Path requiring
    “quotes”

    CMD /k ""c:\batch files\test.cmd" "Parameter 1 with space" "Parameter2
    with space""

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

Sidebar

Related Questions

I try to wrap cmd.exe under windows with the following program but it doesn't
I need to run start cmd.exe /k C:\Program Files (x86)\Mozilla Firefox\sdk\bin\activate & cd d:\home\name\addon\
I have code that launches a program: Process.Start(cmd.exe, /c test.exe \\ > output.txt).WaitForExit(); Although
I'm trying to do this: cmd.exe /C C:\Program Files\Somewhere\SomeProgram.exe > C:\temp\Folder Containing Spaces\SomeProgram.out However,
I sometimes need to run a program from cmd.exe. This only seems to work
I have the following code $env=array('PATH'=>'C:\Program Files\MySQL\MySQL Server 5.1\bin', 'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'); $cmd='mysql --port=3306
I have a c# program through which i am opening cmd window as a
I have a GUI program, which would call a cmd in this GUI program.
Why gives the following Windows 7 .cmd command script: set SUN_JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_17 if
This program builds a dictionary out of a list based on what two index

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.