Solved

Needing to use DOS cmd file as input to an executable

Posted on 2006-06-13
2
194 Views
Last Modified: 2010-04-13
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";
0
Comment
Question by:modotx
  • 2
2 Comments
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
Try escaping the & with a ^ as the & is a command seperator in NT cmd language.

Steve
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
Comment Utility
i.e. use  ^& in the batch file in place of & I mean...
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now