Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sci34hub!eng3!felton From: felton@eng3.UUCP (Ed Felton) Newsgroups: comp.os.msdos.misc Subject: Re: Getting rid of "syntax error" from .bat files - how to? Summary: Magic! Keywords: Neat Tricks with "." Message-ID: <702@eng3.UUCP> Date: 10 Dec 90 22:06:49 GMT References: <9467@pasteur.Berkeley.EDU> Reply-To: felton@eng3.sci.com (Ed Felton) Organization: Itty Bitty Diagnostics Team Lines: 28 Graham Brand writes: }I have written a batch file which accepts parameters from the command }line using the: } if %1==param1 }syntax. It works fine except that if I don't pass any parameters, I }get the above syntax error message. Is there any way to suppress this? ok, here's a simple trick. try: if .%1==.param1 The dot will be there no matter what, as it is put there by you. The error you are getting is when the command.com command line interpreter sees the following: if ==param1 which is so obviously an error that humans can see the problem. the fix suggested above by the way, works the same as the echo. trick to put out blank lines. By the way... Wouldn't it be nice to have a real set of tools for this, instead of DOS's broken stuff? Hey Microsoft! listen to your market! }In addition, is there any way of passing a string, the first character }of which is a dash (-), as in -f? It doesn't seem to work with the }above test.