ZTree.com  | ZEN  | About...  

 Index   Back

'set PUBLIC' vs 'echo %PUBLIC%'   [Q]

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

> CC=
> set public | find "\Users\" >NUL
> if %errorlevel% EQU 0 goto Win10
> if %errorlevel% EQU 1 goto WinXP
>
> CC, xp hates this set public and throws up some random tantrums, it
> says totally undefined.
> CC works for win10.

Please consider: The command "set public" lists ALL variables whose names start with 'public', even longer names.
So the syntax "echo %public%" is safer.

Hartmut

993 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 54 users online (0 registered, 54 guests)
Index | Admin contact |   Forum Time: Mar 28, 2024 - 3:35 pm UTC  |  Hits:62,371,652  (24,049 Today )
RSS Feed