ZTree.com  | ZEN  | About...  

 Index   Back

echo %PUBLIC% | find "\Users\" >NUL doesnt work for XP   [Q]

By: Ryan       
Date: Oct 06,2016 at 14:04
In Response to: difference between XP & Win10? IF NOT "%ALLUSERSPROFILE%"=="C:\ProgramData" way (Hartmut Schneider)

AA=
IF "%PUBLIC%"=="C:\Users\Public" GOTO Win10


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


CC=
set public | find "\Users\" >NUL
if %errorlevel% EQU 0 goto Win10
if %errorlevel% EQU 1 goto WinXP

-------------------------------------------


AA works for XP and win 10

BB doesnt work for XP and works for win10

CC, xp hates this set public and throws up some random tantrums, it says totally undefined.
CC works for win10.

1,000 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 79 users online (0 registered, 79 guests)
Index | Admin contact |   Forum Time: Mar 29, 2024 - 12:55 am UTC  |  Hits:62,386,510  (1,296 Today )
RSS Feed