NOVELL TECHNICAL BULLETIN TITLE: Using IF EXIST...NUL on Network Drives DOCUMENT ID#: TB.P.300 DATE: 3 March 1992 PRODUCT: NetWare, DOS PRODUCT REVISION: All SUPERSEDES: N/A SYMPTOM: Incorrect results when using IF EXIST with the NUL operator on a network drive. ISSUE/PROBLEM Users have reported incorrect results when using the IF EXIST batch file command with the NUL operator to determine whether a directory exists on a network drive. An example of this command is IF EXIST F:\TEST\91\NUL. The error occurs because the NetWare shell sees NUL as a DOS device instead of a filename. As a result, it passes the command to DOS, which does not recognize the network drive (F: in the example above). DOS then ignores the command and returns an exit code of 0 (success). Using the above IF EXIST command on a local drive (for example, IF EXIST C:\TEST\91\NUL) poses no problem to the user, and the appropriate status is returned. SOLUTION There are two possible workarounds to this problem. The first is to use *.* in place of the NUL operator in the IF EXIST statement. This is 100% effective as long as the directory in question is not empty. Users may, as an alternate workaround, redesign their batch file approach to avoid the above limitations. Novell Engineering has determined that in order to address this anomaly (which occurs in the client between DOS and certain shell device drivers), significant re-engineering of the shell would be necessary. This would lead to a drastic increase in the size of the shell. Since such an increase is an unacceptable solution, the user should implement one or both of the two workarounds above.