Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for videorom.bat

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

  1. @ECHO OFF
  2. :: For Windows NT 4/2000/XP only
  3. IF NOT [%OS%]==[Windows_NT] GOTO Syntax
  4. :: No command line parameters required, "/2nd" is for internal use only
  5. IF NOT [%1]==[] IF NOT [%1]==[/2nd] GOTO Syntax
  6.  
  7. :: OK, let's go
  8. SETLOCAL
  9. IF [%1]==[/2nd] (
  10. 	:: DEBUG commands, to be piped to DEBUG.EXE
  11. 	FOR %%A IN ("d C000:0040" "d C000:00C0" "q") DO ECHO.%%~A
  12. ) ELSE (
  13. 	SET Info=
  14. 	:: Recursive call is needed to enable piping screen output to DEBUG.EXE
  15. 	FOR /F "tokens=16* delims= " %%A IN ('^(CMD.EXE /C "%~f0" /2nd 2^>NUL^) ^| DEBUG.EXE ^| FIND "C000:"') DO CALL :Parse "%%B"
  16. )
  17. :: Remove multiple dots
  18. CALL :StripDots
  19. :: Show result with several blank lines inserted in one single ECHO command
  20. ECHO ^
  21.  
  22. Video adapter ROM manufacturer info:^
  23.  
  24. ^
  25.  
  26. %Info%
  27. :: Done
  28. ENDLOCAL
  29. GOTO:EOF
  30.  
  31.  
  32. :AddStr
  33. :: Remove quotes and append to existing string
  34. SET Info=%Info%%~1
  35. GOTO:EOF
  36.  
  37.  
  38. :Parse
  39. :: Remove "unprintable" characters
  40. SET Line=%1
  41. SET Line=%!!|%
  42. SET Line=%Line:<=%
  43. SET Line=%Line:>=%
  44. :: Remove quotes and append to existing string
  45. CALL :AddStr %Line%
  46. GOTO:EOF
  47.  
  48.  
  49. :StripDots
  50. :: Quit when no multiple dots are left
  51. ECHO.%Info% | FIND ".." >NUL
  52. IF ERRORLEVEL 1 GOTO:EOF
  53. :: Remove multiple dots
  54. SET Info=%Info:..=.%
  55. :: Repeat
  56. GOTO :StripDots
  57.  
  58.  
  59. :Syntax
  60. ECHO.
  61. ECHO VideoROM.cmd,  Version 3.00 for Windows NT 4 / 2000 / XP
  62. ECHO Reads and displays manufacturer information from your video adapter ROM
  63. ECHO.
  64. ECHO Usage:  %~n0
  65. ECHO.
  66. ECHO Written by Rob van der Woude
  67. ECHO http://www.robvanderwoude.com
  68. ECHO Original idea by ComputerHope
  69. ECHO http://www.computerhope.com/rdebug.htm
  70.  

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