Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I'm trying to make a universal network boot disk which is based off of the XP MS-DOS Startup disk (see http://www.netbootdisk.com/). The problem is that the ERRORLEVEL variable is never set when using this bootdisk (which I need for testing in a batch file).
Example:
- Open up command.com (or cmd.com) in XP.
- type in "dir"
- type in "echo %errorlevel%"This should output the number 0 (saying that the dir command had no error's of course).
Now do the same thing using the boot disk created with XP (right click floppy drive, select Format, select "Create and MS-DOS startup disk.").
All this outputs is "ECHO is on" - the same thing if you just typed in "echo."
Does anyone have any ideas? Thanks!
(BTW: so far I'm having the same problem when using a PC-DOS 7 bootdisk as well)

I don't know what king of DOS disk XP creates.
But AFAIK, no DOS command interpreter has %errorlevel% built in.
The XP cmd.exe & command.com do.
So you're stuck with the klunky DOS approach.
::== some.bat
@echo off
someapp
if errorlevel 4 goto :4
if errorlevel 3 goto :3
[and so on]:4
set errorlevel=4
goto :eof
:3
set errorlevel=3
goto :eof
[and so on]:eof
::===
M2
If at first you don't succeed, you're about average.

I was so close too! I had tried doing what you had, only I didn't have the errorlevel's in descending order. Thank you very much!

Hi,
I learned that a long time ago; the hard way.
good luck
M2
If at first you don't succeed, you're about average.

![]() |
SBPCI128 under DOS
|
DOS boot disk 'MB intelli...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |