Page 1 of 1 1
Topic Options
#446 - 1999-09-17 10:29 AM DOS Errorlevels and KiXtart
Anonymous
Unregistered


I have one problem. How do I examine Win95īs Find command Errorlevels. I have this kind of line in my scrpits
Shell "Command /C Type %WINDIR%\Status.ini| Find /I "return=0"
Next I have to resolve errorlevel, how?
I hope that this is not a stupid question, but I already tried several time.
Regards
Jyri Virta

Top
#447 - 1999-09-20 09:11 AM Re: DOS Errorlevels and KiXtart
Anonymous
Unregistered


Jyri,
I don't think you can, as "Command /C" always returns 0.
I used an ugly way. Redirect the output from find and check the size of the new file.

/Ben


Top
#448 - 1999-09-20 03:06 PM Re: DOS Errorlevels and KiXtart
Anonymous
Unregistered


If you use version 3.60 of Kixtart, you can
use the Dir() function to mimic this.

Regards,

Brad

Top
#449 - 1999-09-22 02:40 AM Re: DOS Errorlevels and KiXtart
Anonymous
Unregistered


Brad,

I don't follow, how can the dir-function be used ?


/Ben

Top
#450 - 1999-09-22 11:57 AM Re: DOS Errorlevels and KiXtart
Anonymous
Unregistered


The Dir() command can be used similar to a find in the following manner:

If I want to find a particular ini (say win.ini) in c:\winnt, I would use:

$filename=Dir("c:\winnt\win.ini")
if @ERROR=0
? "win.ini exists in c:\winnt."
else
? "win.ini is not in c:\winnt."
endif

If I want to find all of the ini files in c:\winnt, I would use:

$filename=Dir("c:\winnt\*.ini")
while $filename<>"" and @ERROR=0
? "$filename exists in c:\winnt."
$filename=Dir("")
loop

Hope that helps!

Regards,

Brad

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1343 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.049 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org