Search code examples
javascriptbatch-fileflash

.bat check if the page has flash yes or not


The idea is to create a .bat or .html file that when i run it tells me whether a url has a Flash object or not. If webpage have Flash Object, show me a echo and if don't have show me another echo.

I have this .bat ... This thing, seems to check if the page is on or off. But I don't get to check if webpage has a Flash object or not :( This can be done?

@echo off
  setlocal
  set "URL1=https://www.google.com/"
  cscript /nologo /e:jscript "%~f0" %URL1%
  if %ErrorLevel% EQU 200 (
    echo %URL1% Online
  ) else (
    echo %URL1% Off
  )
 pause
  goto :EOF
  
  JScript */
  with(new ActiveXObject("Microsoft.XMLHTTP")){
  open("GET",WSH.Arguments(0));send();
  while(readyState!=4){WSH.Sleep(50)};
  WSH.Quit(status)}

I appreciate any help no matter how long it happens. If you know a free program that does this also helps me.

Thank for read and get nice day.


Solution

  • try with winhttpjs.bat (it should be in the same directory):

    ::testing site with flash
    call winhttpjs.bat http://flash.org/video.php -saveto res.html
    find /i  "http://www.adobe.com/go/getflashplayer" "res.html" >nul 2>nul && (
      echo site has flash
    )||(
      echo site has NO flash
    )
    
    ::testing site WITHOUT flash
    call winhttpjs.bat https://www.google.bg -saveto res.html
    find /i  "http://www.adobe.com/go/getflashplayer" "res.html" >nul 2>nul && (
      echo site has flash
    )||(
      echo site has NO flash
    )