ZTree.com  | ZEN  | About...  

 Index   Back

difference between XP & Win10? IF NOT "%ALLUSERSPROFILE%"=="C:\ProgramData" way   [Q]

By: Ryan       
Date: Oct 05,2016 at 08:46
In Response to: [Q] does ztw64.exe copy faster than ztw.exe? because it is 64 (Ryan)

>IF NOT "%OS%"=="Windows_NT" thing.
>win 10's powershell doesnt response to echo %OS%

i just found out i have to type cmd 1st to make %OS% work.. like this powershell thing>cmd enter

unfortunately it returns to me the same string as XP's Windows_NT
is there a sophisticated way to tell the difference between XP and win 10?

IF NOT "%ALLUSERSPROFILE%"=="C:\ProgramData" GOTO WinXP
or
IF NOT "%PUBLIC%"=="C:\Users\Public" GOTO WinXP

I dont like the C: here, every variable that might distinguish from the XP contains C:

what other way might be there to tell the difference between XP and Win 10.

1,819 views      
Thread locked
 

Messages in this Thread

 
96,637 Postings in 12,231 Threads, 350 registered users, 65 users online (0 registered, 65 guests)
Index | Admin contact |   Forum Time: Mar 28, 2024 - 2:05 pm UTC  |  Hits:62,369,482  (21,879 Today )
RSS Feed