Ben-
BM> To find out if a directory exists on a hard drive or a
BM> floppy drive, I can check for the NUL device.
BM>
BM> IF EXIST c:\path\NUL ECHO c:\path exists
BM>
BM> However, if I want to find out if a directory exists on
BM> a CDRom or network drive, I can't unless it has some file
BM> or subdirectory in it.
BM>
BM> IF EXIST f:\path\*.* echo f:\path exists
BM>
BM> Has anybody overcome this problem yet? thanx
Using FIND and looking for .. works on my cd-rom drive -
I don't know about networks -or- DOS before 6.0
----------------------------------------------------
@echo off
if "%1"=="" goto notenuff
dir %1/ad|find /i ""|find "..">nul
if errorlevel 0 if not errorlevel 1 echo %1 exists
goto end
:notenuff
echo enter %0 drive:\directory_being_looked_for
:end
----------------------------------------------------
I realize it's not a one-liner 8-). Sorry.
Roy
|