Quick batch file to check OS version…

How to check the Operation System version
if OS is 32 bit or 64 bit

Quick batch file to check OS version…


@echo off

Set RegQry=HKLMHardwareDescriptionSystemCentralProcessor

REG.exe Query %RegQry% > checkOS.txt

Find /i “x86” StringCheck.txt

If %ERRORLEVEL% == 0 (

Echo “This is 32 Bit Operating system”

) ELSE (

Echo “This is 64 Bit Operating System”

)

pause

0 Replies to “Quick batch file to check OS version…”

  1. a little more you might like:

    @echo off

    Set RegQry=HKLMHardwareDescriptionSystemCentralProcessor

    REG.exe Query %RegQry% > checkOS.txt

    Find /i “x86” < CheckOS.txt > StringCheck.txt

    If %ERRORLEVEL% == 0 (

    Echo “This is 32 Bit Operating system”

    ) ELSE (

    Echo “This is 64 Bit Operating System”

    )

    pause

    del StringCheck.txt
    del checkOS.txt

    systeminfo | findstr /B /C:”OS Name” /C:”OS Version”

    Set K_=”HKLMSOFTWAREMicrosoftWindows NTCurrentVersion”
    Set “P_=Service Pack 3”
    Reg query %K_% /v CSDversion|Find “%P_%”>Nul 2>&1&&(
    Echo:%P_% Already Installed. Please reboot now && ping -n 60 127.0.0.1>nul)||(
    Echo:Installing %P_%&WindowsXP-KB936929-SP3-x86-ENU.exe /quiet)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.