Document 1117 DIREXIST Command 06/05/92 Novell Desktop Systems Group Some installation batch files will ask the user to provide a directory name to use for their installation. The batch file then checks to see if the directory exists, and if not then it will create one. DR DOS has enhanced many area, but in doing so, a new driver named NUL came in conflict with an older methodology for checking the existance of, and creating directories. The command: IF EXIST %1\NUL will no longer work with DR DOS, however there is an improved batch file parser that actually provides a much more convenient method, the command is: DIREXIST %1 See page 128 of the DR DOS 6.0 User Guide for more information. Example: @ECHO OFF echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ file: IFDIR.BAT ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ echo . . 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 inhancement to batch file processing provides the same º echo º result, but with a more consistant batch file interface. º echo º º 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 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ OOPS!: Need a directory name to create, try: IFDIR.BAT C:\TEST ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ