0

I have list of few exe files that works according to windows edition for ex. there are different files for windows 10 pro , windows 10 home , windows 7 professional ,windows 7 enterprises and so on .

here I want to create a batch file which will detect the windows edition and according to that windows edition my batch file will install the exe file. i can get the windows edition details using wmic os get caption and FOR /F "usebackq tokens=3,4,5" %%i IN (REG query "hklm\software\microsoft\windows NT\CurrentVersion" /v ProductName) DO echo %%i %%j %%k

But I do not know how to put if condition on these commands so that I could run exe file according to windows edition

1 Answers1

0

May you can try:

  1. Remove usebackq:

    FOR /F "usebackq tokens=3,4,5"

  2. Add Apostrophes in ('command loop'):

    ('REG query "hklm\software\microsoft\windows NT\CurrentVersion" /v ProductName')

    • In command line:
    FOR /F tokens^=3-5 %i IN ('REG query "hklm\software\microsoft\windows NT\CurrentVersion" /v ProductName') DO echo %i %j %k
    • In bat file:
    FOR /F tokens^=3-5 %%i IN ('REG query "hklm\software\microsoft\windows NT\CurrentVersion" /v ProductName') DO echo\ %%i %%j %%k
Io-oI
  • 9,237