Jump to content

REQUEST: A script that copies all the video files from a USB camera when plugged in


Recommended Posts

Posted

Hi all,

 

I was wondering if it would be possible for anyone to suggest a way that:

 

1) Students in PE lessons use their six "Flip USB Cameras" to record thier video.

 

2) At the end of the lesson they take back the camera to the PE office and plug it into one of the free six usb cables (connected via USB hub to the PC)

 

3) without any interaction the autorun (or any other mechanism) then copies all the video files from the camera to a network share,

 

4) all video files are deleted on the camera,

 

If anyone has any suggestions for this It would be great as it would mean the PE staff would save hours copying over video files from the 6 cameras at the end of each lesson

 

Thanks in advance!!!!

 

http://www.flipblack.co.uk/res/img/flip-black-usb-arm.png

Posted

Could it be as simple as:

 

autorun containing:

 

[AutoRun]

open=copyfiles.bat

 

 

and a batch file containing:

 

xcopy /e /y .\*.mp4 O:\TEST_FOLDER\

del *.mp4

 

Its XP and I could set the PC in the pe office to autorun usb sticks?

Posted
Could it be as simple as:

 

autorun containing:

 

[AutoRun]

open=copyfiles.bat

 

 

and a batch file containing:

 

xcopy /e /y .\*.mp4 O:\TEST_FOLDER\

del *.mp4

 

Its XP and I could set the PC in the pe office to autorun usb sticks?

 

Would it make any difference with the above bat file to use USBDLM so that the camera always got the same drive letter ?

Posted
yes good thinking, there are 6 of these flip cameras maybe I could give each camera a different drive letter, and im just thinking that i may not even be able to edit the root of the drive :(
Posted
Never had or used one of these cameras so no clue but just thought it would be a hopefully useful tip / hint assuming that it ascertains a drive letter when connected - if not then if you right click on my computer --> manage --> drive management , curious if you can set a drive letter to it that way and access it that way. Also when you first set one of them up do you have to format the storage using a specific file format ie FAT 32 ?
  • Thanks 1
Posted (edited)

thanks for the help...

 

I think ive found a better alternative..

 

"USB Detect & Launch" is a freeware program that runs on the PC in the background monitoring, when it see`s a USB drive inserted (checks every X number of seconds) it can then run any script you like.

 

So, my next question is

 

q) Do any apps like this still run when the PC is locked? Can I set XP to do this? I want the PE staff to simply plug in a walk off !

 

Thanks in advance

 

http://www.endpoint.eclipse.co.uk/wordpress/usb-dal-screenshot.gif

Edited by burgemaster
Posted (edited)

Could someone please help me with the final scripting part?

 

Ive got it to copy all MP4 files from the stick to a test folder, but im thinking that alot will have the same name.

 

Could I possibly have it so that it maybe renames all the AVI files with the date/time and then copies then over??

 

batch so far:

 

@echo off

MODE CON: COLS=75 LINES=20

COLOR 1F

title Copying Files from Flip Camera

echo Copying Files from Camera to O: Drive.....

 

xcopy /e /y /q L:\DCIM\100VIDEO\*.AVI "O:\PE\Student Videos"

 

COLOR CF

PING 1.1.1.1 -n 1 -w 3400 >NUL

COLOR AF

echo Removing files from camera....

PING 1.1.1.1 -n 1 -w 2400 >NUL

 

del /q L:\DCIM\100VIDEO\*.AVI

 

CLS

PING 1.1.1.1 -n 1 -w 2400 >NUL

echo Files copied to O: Drive and removed from camera.....

PING 1.1.1.1 -n 1 -w 2400 >NUL

Edited by burgemaster
Posted

Script complete:

1) copies all files from the camera to destination

2) deletes all files from the camera

 

 

@echo off

MODE CON: COLS=75 LINES=20

COLOR 1F

title Copying Files from Flip Camera

echo Copying Files from Camera to O: Drive.....

 

for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l

for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i

set tm=%tm::=-%

set dtt=%dt%%tm%

Set "sourcefolder=L:\DCIM\100VIDEO"

Set "destinationfolder=O:\PE\Student Videos"

For %%a in ("%sourcefolder%\*.*") Do If exist "%%a" (

xcopy /q /s /c /d /i /y "%%a" "%destinationfolder%\%dtt%-%%~na.*"

)

 

COLOR CF

PING 1.1.1.1 -n 1 -w 3400 >NUL

COLOR AF

echo Removing files from camera....

PING 1.1.1.1 -n 1 -w 2400 >NUL

del /q L:\DCIM\100VIDEO\*.AVI

CLS

PING 1.1.1.1 -n 1 -w 2400 >NUL

echo Files copied to O: Drive and removed from camera.....

PING 1.1.1.1 -n 1 -w 2400 >NUL

Posted
If you're after more advanced lesson programming you can give a shoot to automation anywhere... it has macro run on events like device detection window.
Posted
thanks for the help...

 

I think ive found a better alternative..

 

"USB Detect & Launch" is a freeware program that runs on the PC in the background monitoring, when it see`s a USB drive inserted (checks every X number of seconds) it can then run any script you like.

 

So, my next question is

 

q) Do any apps like this still run when the PC is locked? Can I set XP to do this? I want the PE staff to simply plug in a walk off !

 

Thanks in advance

 

http://www.endpoint.eclipse.co.uk/wordpress/usb-dal-screenshot.gif

 

Read bottom of the image --> "Free for home use, Businesses must buy a license"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...