Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using "enviroset" in DOS Batch File

0 views
Skip to first unread message

Jill McCrea

unread,
Jul 20, 1999, 3:00:00 AM7/20/99
to
Can anyone tell me of a good, resourceful place to go on the internet to
find out how to use "enviroset" in a DOS batch file? I need to write a
batch program (and obviously I'm a newbie) that will call a setup.exe (no
problem) but then I need the batch program to search the machine for a
specific text file and then based on whether or not the text file was found,
I need to set a DOS variable to yes/no, true/false whatever, to represent
finding/not finding the text file.
Much thanks,
Jill
mcc...@tdbank.ca

Phil Robyn

unread,
Jul 20, 1999, 3:00:00 AM7/20/99
to
Jill McCrea wrote:

What is 'enviroset'? What version of 'DOS' (i.e., Windows) are you
using? An excellent source of information is the alt.msdos.batch
newsgroup.


Erol Ozbek

unread,
Jul 21, 1999, 3:00:00 AM7/21/99
to
Dear Jill,
As I am no programmer, I am not sure what you mean, but for verifying the
existence of a file you can use the "ifexist" command of DOS:


ifexist <drive, path, filename> then <whatever command>

(I used it in DOS 6, but a warning: When I tried it with diskettes it worked
only if any diskette was in drive A: and if A: was empty, the batch file
came to a halt. Probably you can fix that, using errorlevel or error code
returns.

Make it easy,
Erol


Jill McCrea <mcc...@tdbank.ca> wrote in message
news:eUvzM7u0#GA.222@cppssbbsa03...

Outsider (6.22/3.11)

unread,
Jul 22, 1999, 3:00:00 AM7/22/99
to
Jill McCrea wrote:
>
> Can anyone tell me of a good, resourceful place to go on the internet to
> find out how to use "enviroset" in a DOS batch file? I need to write a
> batch program (and obviously I'm a newbie) that will call a setup.exe (no
> problem) but then I need the batch program to search the machine for a
> specific text file and then based on whether or not the text file was found,
> I need to set a DOS variable to yes/no, true/false whatever, to represent
> finding/not finding the text file.
> Much thanks,
> Jill
> mcc...@tdbank.ca

Here's an example for the c drive.

DIR/A-D/B/S c:\*.* |FIND.EXE "filename.any" >nul
IF not errorlevel=1 SET found=yes

Regards,
Outsider

0 new messages