Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

winver too restrictive #5

Closed
henfri opened this issue Nov 21, 2021 · 4 comments
Closed

winver too restrictive #5

henfri opened this issue Nov 21, 2021 · 4 comments
Labels
new-feature New feature for WSAtools

Comments

@henfri
Copy link

henfri commented Nov 21, 2021

Is your feature request related to a problem? Please describe.
Would be nice if further windows versions would be supported

Describe the solution you'd like
I use the script on 22000.348 successfully (having patched the *.bat)

But maybe it would work on 318 as well... I will check if I can check.

Best regards,
Hendrik

@henfri henfri added the new-feature New feature for WSAtools label Nov 21, 2021
@weareblahs
Copy link
Owner

weareblahs commented Nov 21, 2021

Just curious - is there any way to let command prompt detect something like this:
Microsoft Windows [Version 10.0.22000.348] but it detects 22000 only.

Here's the excerpt from the original script:

if %check% == 10.0.22000.348 (
:: Success screen
  cls
  echo Windows version up-to-date, which means it supports Windows Subsystem for Android. 
  echo Launching in 3 seconds...
  timeout 1 > NUL
  cls
  echo Windows version up-to-date, which means it supports Windows Subsystem for Android. 
  echo Launching in 2 seconds...
  timeout 1 > NUL
  cls
  echo Windows version up-to-date, which means it supports Windows Subsystem for Android. 
  echo Launching in 1 seconds...
  timeout 1 > NUL
  del checkver.bat
  cls
  cd main
  WSATools
  pause >nul

Wonder that can I just simply change if %check% == 10.0.22000.348 ( to if %check% == *22000* (. I'm not sure about this kind of stuffs on command prompt. This detects all Win11 versions and let it to run by itself.

@henfri
Copy link
Author

henfri commented Nov 21, 2021

Maybe something like this:
@echo off & setlocal

for %%a in (%check%) do 
if %%a ==22000

@henfri
Copy link
Author

henfri commented Nov 21, 2021

No, that only works if it is space separated.

then more like this one:

for /f "tokens=2 delims=_" %%a in ("%STRING%") do (
  set AFTER_UNDERSCORE=%%a
)

Or:

%check% == 10.0.22000.348
echo %check:~5,5%
should give 22000

Best regards,
Hendrik

@weareblahs
Copy link
Owner

I think it should be working properly to detect all Win11 versions after changing to this:

for /f %%N in ('checkver') do set "check=%%N"
for /f %%N in ('echo %check:~5,5%') do set "check2=%%N"
if %check2% == 22000 (
:: Success screen

Thanks. Will use this at v0.0.8b, which will be published later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-feature New feature for WSAtools
Projects
None yet
Development

No branches or pull requests

2 participants