The following package code will do this. Note that you will need to run cmd using the following command line:
cmd /v:on
to enable advanced change of environment variables. Also note that it will select a random number of files from 0 to 32767 - you probably want to change this part to suit your requirements!
@ECHO OFF SET SrcCount=0 SET SrcMax=%RANDOM% FOR %F IN (C:\temp\source\*.*) DO IF !SrcCount! LSS %SrcMax% ( SET /A SrcCount += 1 ECHO !SrcCount! COPY %FC:\temp\output COPY %FC:\temp\output )
source share