Needing to use DOS cmd file as input to an executable

I am trying to use the results of a DOS command file as input to an executable.  However, the results contains an ampersand that is supposed to be next to a a string but always winds up with a space (blank character) between the ampersand and the next character.  Does anyone know why this is?  What do I do

EX: Assuming "test" was the parameter
submit file=e:\ndm\proc\XN000.cdp &SrcFile=%1;

Winds up looking like the following:
submit file=e:\ndm\proc\XN000.cdp   & SrcFile="test";

But I want it to look like the following instead:
submit file=e:\ndm\proc\XN000.cdp &SrcFile="test";
modotxAsked:
Who is Participating?
 
Steve KnightConnect With a Mentor IT ConsultancyCommented:
i.e. use  ^& in the batch file in place of & I mean...
0
 
Steve KnightIT ConsultancyCommented:
Try escaping the & with a ^ as the & is a command seperator in NT cmd language.

Steve
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.