The "" already accounts for NUL values.

All you need is a single character besides the environment variable.
I choose double quotes, because it will work with variables containing
a space.


==============================================================
 ASB - http://www.ultratech-llc.com/KB/?File=~MoreInfo.TXT
==============================================================
 "Adult, n.: One old enough to know better."



>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, September 13, 2001 7:58 PM
>To: NT System Admin Issues
>Subject: RE: Multiple OSes and Login Scripts
>
>
>On Thu, 13 Sep 2001, Andrew S. Baker wrote:
>> * Additionally, you should use quotes when comparing environment
>> variables.  For example:
>>
>> if "%OS%"=="Windows_NT" net use u: \\server1\Users\%USERNAME% /yes
>
>  The really paranoid check for null values, too:
>
>if "%OS%x"=="x" goto OS_UNKNOWN
>if "%OS%"=="Windows_NT" goto OS_NT
>...
>goto OS_UNKNOWN
>
>--
>Ben Scott <[EMAIL PROTECTED]>
>| The opinions expressed in this message are those of the
>author and do not |
>| necessarily represent the views or policy of any other
>person, entity or  |
>| organization.  All information is provided without
>warranty of any kind.  |
>


http://www.sunbelt-software.com/ntsysadmin_list_charter.htm

Reply via email to