Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for win3264.bat

(view source code of win3264.bat as plain text)

  1. @ECHO OFF
  2. IF NOT "%OS%"=="Windows_NT" GOTO Syntax
  3. IF "%~1"=="" GOTO Run
  4.  
  5.  
  6. :Syntax
  7. ECHO.
  8. ECHO Win3264.bat,  Version 1.00 for Windows NT 4 and later
  9. ECHO Check if Windows is a 32 or 64-bits version
  10. ECHO.
  11. ECHO Usage:   WIN3264
  12. ECHO.
  13. ECHO Returns: The result will be displayed on screen, and a return
  14. ECHO          code ("errorlevel") of 32 or 64 will be returned
  15. ECHO.
  16. ECHO Written by Rob van der Woude
  17. ECHO http://www.robvanderwoude.com
  18. ECHO.
  19. ECHO.
  20.  
  21.  
  22. :Run
  23. IF DEFINED ProgramFiles(x86) (
  24. 	FOR /F "tokens=1 delims=[" %%A IN ('VER') DO ECHO %%A^(64-bits^)
  25. 	EXIT /B 64
  26. ) ELSE (
  27. 	FOR /F "tokens=1 delims=[" %%A IN ('VER') DO ECHO %%A^(32-bits^)
  28. 	EXIT /B 32
  29. )
  30.  

page last uploaded: 2017-07-06, 12:37