TIP: Click on subject to list as thread! ANSI
echo: batpower
to: ALL
from: Roy.Reed@f50.n377.z1.fidonet.org (Roy Reed)
date: 1997-03-13 00:00:00
subject: cd-rom + network


  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

SOURCE: alt.fidonet via archive.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.