|hello everyone, |
i need some help, i'm trying to write a
batch/cmd file to copy files from a removable
dvr, so far i have spent about 5 hours cursing
at my laptop with no luck, i'm hoping some
one will be able to give me a hand.
ok, heres what i'm aiming for. i have a small
drv mounted in my 4x4 for recording and a
tablet pc in a sealed case, the dvr charges
from the usb but when the usb is plugged into
pc acts only in file access mode.
so i'm going to put a switch in the usb data
line to switch between charge/file access
i wish to place a autorun file on he flash card
to run a batch on connection. to copy the files
sequentially into a directory on pc
i want the batch to first check for a directory
called "vids" in the root c:\ and if it doesnt
exist create it, i have sorted code for this.
IF EXIST C:\VIDS\ GOTO YES
ECHO DIRECTORY CREATED
ECHO DIRECTORY EXISTS
i then want the batch file to count the number
of files on the dvr
for /F %%a in ('dir /b/a-d-h ^| find /c "%ext%"')
do set cam=%%a
seams to work for this when run from the
same directory as files, but i can't get it to
work for vids directory.
i can get it to work by
for /f "tokens=1" %%f in ('dir
"%folder%\*.*"^|findstr /c:" File(s)"') do set
its from here on i'm really stuck, once the
program has worked out the start number for
the files (number of files in vids dir +1) i want it
to rename and move the avi files from the dvr
to the vids directory in sequential format ie:
001, 002, 003, etc
i found this copy for naming but again i'm
struggling to get it working
for /f "tokens=* %%a in ('dir /b *.jpg') do (
set /a N+=1
if !N! LSS 1000 set S=!N!
if !N! LSS 100 set S=0!N!
if !N! LSS 10 set S=00!N!
rename "%%a" !S!.avi
xing fingers somone can help me with this