PC Review


Reply
Thread Tools Rate Thread

carriage return in environment variable?

 
 
Nunayadam Bidnez
Guest
Posts: n/a
 
      29th Aug 2004
Here's an interesting one I've been wrestling with for a bit now and
figured it was time to post in a ng

using wmic get /value in a for/do command to set environment variables
results in the resultant environment variables. This causes me to not be
able to use the variables in scripts because when i echo the variable
any variables that have only the carriage return (and no other
characters) results in ECHO is on and thusly the breakage in scripts.

Is there some method of modifier in doing set such that carriage returns
are not passed to variables. I have never seen this before and am about
ready to give up

thanks in advance


 
Reply With Quote
 
 
 
 
Matthias Tacke
Guest
Posts: n/a
 
      29th Aug 2004
"Nunayadam Bidnez" wrote:

>Here's an interesting one I've been wrestling with for a bit now and
>figured it was time to post in a ng
>
>using wmic get /value in a for/do command to set environment variables
>results in the resultant environment variables. This causes me to not be
>able to use the variables in scripts because when i echo the variable
>any variables that have only the carriage return (and no other
>characters) results in ECHO is on and thusly the breakage in scripts.
>
>Is there some method of modifier in doing set such that carriage returns
>are not passed to variables. I have never seen this before and am about
>ready to give up
>
>thanks in advance
>


Set can't handle multiline values, but the effect occurs with empte vars.

Simply put a different valid delimiter than a space after the echo.
AFAIK valid delimiters are .:,;/\(+=

set "emptyvar="
echo:%emptyvar%

HTH
--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
 
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
Adding a Hard Return or carriage return in an update query? Lakota2k Microsoft Access Queries 1 15th Sep 2008 04:56 AM
how to convert from CVS file to Carriage return seperated variable =?Utf-8?B?RGF2aWQ2Mw==?= Microsoft Word Document Management 1 23rd Aug 2006 06:42 PM
Search and replace hard-line-return character, not carriage return =?Utf-8?B?VHlsZXIgVA==?= Microsoft Word Document Management 2 16th Aug 2006 09:11 PM
Environment variable inside an environment variable murdo Microsoft Windows 2000 CMD Promt 7 25th Feb 2005 06:11 PM
Urgent: Creating an Environment Variable (System Variable)? =?Utf-8?B?U2F1cmFiaA==?= Microsoft Dot NET Framework 1 7th Feb 2005 05:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:21 AM.