1.

Solve : Dos and .bat mismatch ????

Answer»

Hi,

I have a problem I'm hoping someone knows the answer to. I'm writing a program that contains a code that counts the number of times a string appears in a particular file.

I tested the line of code in the MS-DOC WINDOW and it works fine and generates an output:
FOR /F "tokens=*" %A IN ('FIND /C "E:" "testing.log"') DO SET testing=%A

So I copied the line exactly into notepad and saved it as a .bat file. But now when I run the file it gives me an error:
" "testing is unexpected at this time.

I don't know why this is HAPPENING because the line works in the dos window, but not as a BATCH file.

I hope someone can SPOT the problem is because I'm BAFFLED.



Discussion

No Comment Found