HOME       >>       Programming

Search For Video Files And Display Them Using a batch file in windows


In windows you need to be able to see the file's extension so you can rename a .txt file to .bat

This batch code I wrote searches your C:\ drive for video files and drops the results into a file. That file is then processed into links on a web-page. The web-page is then opened for you to view. Click the links to view the file, right click -> save as to save to another place on your computer. I use it a lot after browsing videos on the web. It's fun to see what videos end up cached (left on the computer from browsing)

Insert this into a file named vid-search.txt
Then save, rename the file vid-search.bat
Then open the vid-search.bat file like you would any file. It will work its magic.

Xeek is just one of my many online aliases

@echo offclsecho.echo.echo ****************************echo **** ****echo *** Video Finder by Xeek ***echo **** ****echo ****************************echo.echo.echo Searching for flv filesdir /o-s/b/s/l c:\*.flv >>.\vidz.txtecho.echo Searching for avi filesdir /o-s/b/s/l c:\*.avi >>.\vidz.txtecho.echo Searching for mpg filesdir /o-s/b/s/l c:\*.mpg >>.\vidz.txtecho.echo Searching for mpeg filesdir /o-s/b/s/l c:\*.mpeg >>.\vidz.txtecho.echo Searching for mov filesdir /o-s/b/s/l c:\*.mov >>.\vidz.txtecho.echo Searching for asf filesdir /o-s/b/s/l c:\*.asf >>.\vidz.txtecho.echo Searching for wmv filesdir /o-s/b/s/l c:\*.wmv >>.\vidz.txtecho.echo Searching for divx filesdir /o-s/b/s/l c:\*.divx >>.\vidz.txtecho.echo Searching for ram filesdir /o-s/b/s/l c:\*.ram >>.\vidz.txtclsecho Processing...echo ^<h1 align="center"^>Vid Finder by Xeek^</h1^>^<hr^>^<font face="Courier New" size=1^> >.\vidz.htmlfor /F "tokens=*" %%v in (.\vidz.txt) do @echo ^<a href="%%v"^>%%v^</a^>^<br^> >>.\vidz.htmlstart .\vidz.html MAXdel .\vidz.txt

Maybe someone can help script a better way to present the results?


Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.