Echo to file with batch programing -


i want learn echo file, batch programing.

my batch :

@echo off echo hello world > c:\text.txt 

text.txt result :

hello world 

it seccessfully

but if batch file (added '"'):

 @echo off  echo hello '"' world > c:\text.txt 

result :

microsoft windows [version 6.1.7601] copyright (c) 2009 microsoft corporation.  rights reserved.  c:\users>echo hello '"' world > c:\text.txt hello '"' world > c:\text.txt 

why text.txt not created?

you should escape single double quote:

echo hello '^"' world>test.txt 

otherwise echo parser waiting closing double quote , > redirection remains escaped quote.


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

java - What is the difference between String. and String.this. ? -