@echo off
set USB=
for %%a in (C D E F G H I J K L M N O P Q R S) do if exist %%a:\winx\22h2\sources\setup.exe (
set USB=%%a
goto check
)
echo nu am gasit kitul de win10 22H2
pause
goto Exit
:check
for /f "tokens=6*" %%6 in ('vol %USB%:') do (
if not x==x%%6 (
if x%%6==xNTFS (
goto Next
)
set USB=
)
)
echo am gasit kit dar nu corespunde Volum Label
pause
goto Exit
:Next
@echo usb=%USB%
%USB%:\winx\22h2\sources\setup.exe
:Exit