Solved Batch Script Limitation Error?

May 23, 2012 at 02:11:25
Specs: Windows 7
hi, i have created a batch file that reads a text file and prints each word into a new text file, ignoring words it has seen before. It also removes any punctuation from the words as it outputs them.
The problem i have is that half way through running the script the batch file starts to print every line of code in the batch file into the console.
The program still works when this happens, but punctuation is no longer removed.

Is this a common error of batch script or have i done something wrong?

See More: Batch Script Limitation Error?

Report •

May 23, 2012 at 02:36:29
✔ Best Answer
My guess is that your script uses echo to output text and you are using a space as the echo delimiter. Once the word "on" is encountered echo interprets it as an argument to turn on verbose mode.

My advice would be to use a opening parenthesis character"(" as the echo delimiter. There are other options but they have there own issues.


Report •

May 23, 2012 at 02:58:14
I looked over my script and you are 100% correct
Using "(" fixed the problem entirely - Thanks heaps!

Report •

May 23, 2012 at 05:22:03
Side note: Back in the day, Microsoft's recommendation was to use echo. (as in echo dot) instead of just echo (as in echo).

How To Ask Questions The Smart Way

Report •

Related Solutions

May 23, 2012 at 06:28:59

They did but it can still fail.

I don't like "(" aesthetically, but am yet to see it fail. This thread has details of all the edge cases I know of(".:\/,=;+[]"):

Report •

Ask Question