

NOVELL TECHNICAL INFORMATION DOCUMENT

DOCUMENT PROCESSING INFO:  THIS DOCUMENT REPLACES FYI-M-1117
TITLE:  Using the DIREXIST command
DOCUMENT ID:  TID800042
DOCUMENT REVISION:  A
DATE:  16AUG94
AUTHOR:  KBANTA;CEREKSON
ALERT STATUS:  Yellow
DISTRIBUTION:  Public
INFORMATION TYPE:  Symptom Solution
README FOR:  NA
NOVELL PRODUCT CLASS:

Desktop Products

NOVELL PRODUCT and VERSION:

DR DOS 6.0

CATEGORY:

Disk Utilities

ABSTRACT:

NA

-----------------------------------------------------------------
DISCLAIMER
THE ORIGIN OF THIS INFORMATION MAY BE INTERNAL OR EXTERNAL TO NOVELL. 
NOVELL MAKES EVERY EFFORT WITHIN ITS MEANS TO VERIFY THIS INFORMATION. 
HOWEVER, THE INFORMATION PROVIDED IN THIS DOCUMENT IS FOR YOUR INFORMATION
ONLY.  NOVELL MAKES NO EXPLICIT OR IMPLIED CLAIMS TO THE VALIDITY OF THIS
INFORMATION.
-----------------------------------------------------------------

SYMPTOM

UNABLE TO USE BATCH COMMAND IF EXIST %\NUL

ISSUE/PROBLEM

The command:  IF EXIST %1\NUL will no longer work with DR DOS.

SOLUTION

Use the batch command DIREXIST.  There is an improved batch file parser
that actually provides a much more convenient method, the command is: 
DIREXIST %1

ADDITIONAL REFERENCE:  DR DOS 6.0 User Guide, page 128.

EXAMPLE:

@ECHO OFF
-----------------------------------------------------------------
echo  ¦ file: IFDIR.BAT                                                 
¦
-----------------------------------------------------------------

echo  .                                                                 
.
-----------------------------------------------------------------
echo  ¦ Testing DIREXIST directory creation from a batch file           
¦
echo  ¦                                                                 
¦
echo  ¦ NOTE:               IF NOT EXIST %1\NUL                         
¦
echo  ¦                                                                 
¦
echo  ¦ The above convention does not work with DR DOS as a device      
¦
echo  ¦ driver called NUL has been loaded for additional functionality. 
¦
echo  ¦                                                                 
¦
echo  ¦ An enhancement to batch file processing provides the same       
¦
echo  ¦ result, but with a more consistent batch file interface.        
¦
echo  ¦                                                                 
¦
-----------------------------------------------------------------
if "%1"=="" goto oops
if DIREXIST %1 echo Directory Already Exists

IF NOT DIREXIST %1   MD %1

if DIREXIST %1 echo Directory %1 made with DIREXIST.
dir *.
exit

:oops
-----------------------------------------------------------------
echo  ¦ OOPS!:  Need a directory name to create, try:  IFDIR.BAT C:\TEST
¦
-----------------------------------------------------------------


-----------------------------------------------------------------
Any trademarks referenced in this document are the property of their
respective owners.  Consult your product manuals for complete trademark
information.
-----------------------------------------------------------------
