Solved

Needing to use DOS cmd file as input to an executable

Posted on 2006-06-13
2
195 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
ID: 16898722
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
ID: 16898727
i.e. use  ^& in the batch file in place of & I mean...
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
We need a new way to communicate time sensitive or critical info.   The best part of my role at xMatters is visiting our clients all over the world to learn about how they operate their businesses, share insights that xMatters has gleaned across…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

16 Experts available now in Live!

Get 1:1 Help Now