Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 2,564 Posts 1,127 Joined 2006-12-25 22:57 19-year member UID 74552 Gender Male
Status Offline
Originally posted by fbwolf at 2007-9-23 04:05 PM:
As the title suggests
I hope that the experts will inform me in an example way, and I am very grateful!
C:\>echo abcd>a.txt
C:\>set /p test=<a.txt
C:\>echo %test%
abcd
C:\>
C:\>set test=a
C:\>if defined test (echo Variable test exists) else (echo Variable test does not exist)
Variable test exists
C:\>if not defined test (echo Variable test does not exist) else (echo Variable test exists)
Variable test exists
C:\>set test=
C:\>if defined tset (echo Variable test exists) else (echo Variable test does not exist)
Variable test does not exist
C:\>if not defined tset (echo Variable test does not exist) else (echo Variable test exists)
Variable test does not exist