ZTree.com  | ZEN  | About...  

 Index   Back

if errorlevel: order is relevant   [Q]

By: Hartmut Schneider     Germany  
Date: Oct 06,2016 at 15:55
In Response to: echo %PUBLIC% | find "\Users\" >NUL doesnt work for XP (Ryan)

> BB=
> echo %PUBLIC% | find "\Users\" >NUL
> if errorlevel 0 goto Win10
> if errorlevel 1 goto winXP

> BB doesnt work for XP and works for win10

Put the 'errorlevel 1' line first.
Please consider the 'help if' description:
"if errorlevel n" is true for return values greater or equal n. So the order is relevant in that syntax.

Hartmut

1,015 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 85 users online (0 registered, 85 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 11:22 am UTC  |  Hits:62,403,495  (18,281 Today )
RSS Feed