Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for msiinfo.bat

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

  1. @ECHO OFF
  2. IF NOT "%OS%"=="Windows_NT" GOTO Syntax
  3. IF      "%~1"==""           GOTO Syntax
  4.  
  5. SETLOCAL
  6. FOR /F "tokens=*" %%A IN ('REG Query "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows"') DO (
  7. 	SET Latest=%%A
  8. )
  9. FOR /F "skip=2 tokens=2*" %%A IN ('REG Query "%Latest%\WinSDKTools" /v InstallationFolder') DO (
  10. 	IF EXIST "%%~B.\MsiInfo.exe" (
  11. 		"%%~B.\MsiInfo.exe" %*
  12. 	) ELSE (
  13. 		ECHO MsiInfo.exe not found.
  14. 		ENDLOCAL
  15. 		GOTO Syntax
  16. 	)
  17. )
  18. ENDLOCAL
  19. GOTO:EOF
  20.  
  21.  
  22. :Syntax
  23. ECHO.
  24. ECHO MsiInfo.bat,  Version 1.00
  25. ECHO Automaticaly run the latest version of MsiInfo.exe installed on the computer
  26. ECHO.
  27. ECHO Usage:  MSIINFO  msifile  [ options ]
  28. ECHO.
  29. ECHO Type MSIINFO /? for more details on the options
  30. ECHO.
  31. ECHO Written by Rob van der Woude
  32. ECHO http://www.robvanderwoude.com
  33.  
  34. IF "%OS%"=="Windows_NT" COLOR 00
  35.  

page last modified: 2024-04-16; loaded in 0.0054 seconds