M
Maansi Sanghi
Hello,
(1) I have created a batch file "test.bat" which takes a parameter from
command line and writes it to a file. The Batch has just one command which
is mentioned below.
echo %1 >>Test.txt
(2) The problem is that the input paramater can be a string which can have
both spaces and quotes within it.
Problem arrises with command line strings which have BOTH quotes and spaces
a) A Space can be handled by surrounding Quotes
b) When a String contains a Quote
c) When there is a String and Quote both
The escape chatacter ^ also does not work over here
My operating system is Windows Professional. Is it possible to accept
strings which may contains both quotes and spaces as paramateres??
Regards,
Maansi
(1) I have created a batch file "test.bat" which takes a parameter from
command line and writes it to a file. The Batch has just one command which
is mentioned below.
echo %1 >>Test.txt
(2) The problem is that the input paramater can be a string which can have
both spaces and quotes within it.
Problem arrises with command line strings which have BOTH quotes and spaces
a) A Space can be handled by surrounding Quotes
test.bat "TESTSPACE ONLY"
b) When a String contains a Quote
There is an error in the above commandtest.bat "TESTQUOTE" ONLY"
c) When there is a String and Quote both
It only takes the part TestQuotetest.bat "TESTQUOTE" And Space"
The escape chatacter ^ also does not work over here
My operating system is Windows Professional. Is it possible to accept
strings which may contains both quotes and spaces as paramateres??
Regards,
Maansi