PC Review


Reply
Thread Tools Rate Thread

How can I remove double quote

 
 
Alan Tang
Guest
Posts: n/a
 
      24th Jan 2006
Hello:

How can I remove the double quote when echo a env var?

set TEST="Test 1 2 3 4"

echo %TEST% will be "Test 1 2 3 4"
how can be the result is Test 1 2 3 4 ?

Thanks!
 
Reply With Quote
 
 
 
 
William Allen
Guest
Posts: n/a
 
      24th Jan 2006
"Alan Tang" wrote in message
> Hello:
>
> How can I remove the double quote when echo a env var?
>
> set TEST="Test 1 2 3 4"
>
> echo %TEST% will be "Test 1 2 3 4"
> how can be the result is Test 1 2 3 4 ?


Use the :string1=string2 substitution syntax with a nul string2.
See SET /? for full details.

Typical syntax:
ECHO. The unquoted contents of MyVar are %MyVar:"=%

--
William Allen
Free interactive Batch Course http://www.allenware.com/icsw/icswidx.htm
Batch Reference with examples http://www.allenware.com/icsw/icswref.htm
From email address not checked. Contact us at http://www.allenware.com/


 
Reply With Quote
 
Jerold Schulman
Guest
Posts: n/a
 
      24th Jan 2006
On Tue, 24 Jan 2006 19:39:50 +0900, Alan Tang <(E-Mail Removed)> wrote:

>Hello:
>
>How can I remove the double quote when echo a env var?
>
>set TEST="Test 1 2 3 4"
>
>echo %TEST% will be "Test 1 2 3 4"
>how can be the result is Test 1 2 3 4 ?
>
>Thanks!


set TEST="Test 1 2 3 4"

set test=%TEST:"=%
echo %TEST% will be Test 1 2 3 4


Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If single-quote and double-quote are in text Bob Barnes Microsoft Access 2 25th Nov 2007 09:56 PM
Datagrid on load; replace all double single quote to single quote to display to user Eric Layman Microsoft ASP .NET 3 14th Apr 2007 08:16 AM
double quote in sql Greg Chu Microsoft VB .NET 4 19th Jan 2005 09:58 AM
Replace Double-Quote Kevin Thomas Microsoft VB .NET 4 18th Oct 2004 08:03 PM
double quote as its own string Craig Microsoft Access VBA Modules 2 28th May 2004 08:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:46 AM.