Skip to content

env.bat using errorlevels #813

Closed
Closed
@andsch11

Description

@andsch11

env.bat (and maybe others) use a line like the following:
echo ";%PATH%;" | %FINDDIR%\find.exe /C /I ";%WINPYDIR%\;" >nul
find.exe sets the system variable ERRORLEVEL to 1 if it does not find anything.

This is an issue if env.bat is used within other scripts depending on the system variable ERRORLEVEL.
Reasons:

  1. after calling env.bat it is now necessary to manually reset the ERRORLEVEL variable
    1.1. NOTE: cannot be done with set ERRORLEVEL=0 (that creates a new variable hiding the orignal one)
  2. after calling env.bat, it is unclear if the errorlevel was set because of some real error in it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions