Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Script to randomly play vid file from folder
Name: pball Date: May 27, 2009 at 19:58:01 Pacific OS: Windows XP CPU/Ram: 2.8 ghz / 2 gig Product: Home made / NONE Subcategory: General
Comment:
I have a few hundred short videos and I don't want to pick out which ones to watch, cause I'll end up watching my favorites first. So I'm wondering if someone could script something up to pick a random video then open it. Then when done move that to a new directory.
Name: Razor2.3 Date: May 28, 2009 at 13:35:47 Pacific
Reply:
I have an old script (apparently written during some summer break in college) that makes a list of X files Z lines long, called Y. It isn't perfect, but it should get you started.
The command line is: script <what to look for> <output> <desired size of list> ie: mrandlist c:\videos\*.avi list.txt 50
@echo off
if ()==(%3) exit /b 255
dir /b /s /a-d %1 > "%temp%\listing.txt"
for /f "delims=:" %%a in ('type %temp%\listing.txt ^| findstr /n "."') do @set maxRand=%%a
if exist %2 del %2
for /l %%a in (1,1,%3) do call :output %2
del "%temp%\listing.txt"
goto :eof
:output
set /a rand=(%random% %% %maxRand%) + 1
set /a maxRand -= 1
for /f "tokens=1* delims=:" %%J in ('type "%temp%\listing.txt" ^| findstr /n "." ^| findstr "^%rand%:"') do @echo "%%K">> %*
for /f "tokens=1* delims=:" %%J in ('type "%temp%\listing.txt" ^| findstr /n "." ^| findstr /v "^%rand%:"') do @echo %%K>> "%temp%\listingTMP.txt"
move "%temp%\listingTMP.txt" "%temp%\listing.txt"
goto :eof
Summary: Hi gurus, I need to write a batch script to copy the files from first folder, that begin with a perticular string (say begin with test, having files test1, test 2 etc) to folder B. We need to copy all...
Summary: I have .sql files with timestamps in a folder like: hddaily 20081130 0600.sql, hddaily 20081129 0600.sql, hddaily 20081130 0600.sql, etc. Filename is “hddaily yyyyMMdd HHmm.sql” Format. I need use...
Summary: How to delete a particular file from many folders. For example there are many folders in particular location say c:\temp\folder1 in c:\temp there are many folders like folder1,folder2,folder3.... fold...