dalw@vax87.aud.auc.dk (02/05/90)
Hello !! I need a program to check wether a certain data-path exists or not. Here's my problem : The user have to give in where he want's his data to be stored when starting up a given program from Dos. Normally he would start the program like this: C:\>f:\wp\wp/ps=a:\wpdata but I would like to put it in a BAT file instead. The BAT file could look like this: ---------------------------------------------------------------------------- @echo off :again cls echo echo Your data-path please ! (fx. a:, a:\, c:\wpdata, z:\data). answer Data-path : ** answer places the data-path in an environment ** variable called answer. XX ** XX indicates the program that I need to confirm ** wether answer exists or not. The program have to ** set an environment variable fx. data = true if the ** path exists otherwise set data = false if %data%=thrue goto goon echo echo Wrong data-path - try again !! goto again :goon f:\wp\wp/ps=%answer% cls c: ----------------------------------------------------------------------------- Please mail as soon as possible. Luis Winther Aalborg University Center Denmark dalw@vax87.aud.auc.dk
ed.leslie@canremote.uucp (ED LESLIE) (02/11/90)
dalw@vax87.aud.auc.dk writes:
dk>I need a program to check wether a certain data-path exists or not.
Following is a fragment of a batch file which I just made up and tried.
Works OK, and should give you the general direction to work on.
-------------starts---------------
set target=c:\wpfiles
if exist %target%\*.* goto ok
echo files not found
goto end
:ok
echo files were found
:end
-------------ends-------------------
The test for *.* could of course be modified to test for an individual
file which you know must be there, or several lines could be used to test
for more than one file. Anyway, the above should get you started.
TTFN <ed.leslie@canremote.uucp
---
~ DeLuxe 1.11a20 #1656