+ Post New Thread
Results 1 to 10 of 10
Scripts Thread, REQUEST: A script that copies all the video files from a USB camera when plugged in in Coding and Web Development; Hi all, I was wondering if it would be possible for anyone to suggest a way that: 1) Students in ...
  1. #1

    Join Date
    Aug 2007
    Posts
    802
    Thank Post
    95
    Thanked 60 Times in 45 Posts
    Rep Power
    25

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

    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!!!!


  2. #2

    Join Date
    Aug 2007
    Posts
    802
    Thank Post
    95
    Thanked 60 Times in 45 Posts
    Rep Power
    25
    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?

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,228
    Thank Post
    2,773
    Thanked 937 Times in 877 Posts
    Rep Power
    343
    Quote Originally Posted by burgemaster View Post
    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 ?

  4. #4

    Join Date
    Aug 2007
    Posts
    802
    Thank Post
    95
    Thanked 60 Times in 45 Posts
    Rep Power
    25
    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

  5. #5

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,228
    Thank Post
    2,773
    Thanked 937 Times in 877 Posts
    Rep Power
    343
    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 ?

  6. Thanks to mac_shinobi from:

    burgemaster (14th July 2010)

  7. #6

    Join Date
    Aug 2007
    Posts
    802
    Thank Post
    95
    Thanked 60 Times in 45 Posts
    Rep Power
    25
    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

    Last edited by burgemaster; 14th July 2010 at 08:28 PM.

  8. #7

    Join Date
    Aug 2007
    Posts
    802
    Thank Post
    95
    Thanked 60 Times in 45 Posts
    Rep Power
    25
    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
    Last edited by burgemaster; 15th July 2010 at 09:52 AM.

  9. #8

    Join Date
    Aug 2007
    Posts
    802
    Thank Post
    95
    Thanked 60 Times in 45 Posts
    Rep Power
    25
    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

  10. #9

    Join Date
    Jul 2010
    Location
    NL
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

  11. #10

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,228
    Thank Post
    2,773
    Thanked 937 Times in 877 Posts
    Rep Power
    343
    Quote Originally Posted by burgemaster View Post
    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

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

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 5
    Last Post: 13th November 2009, 10:12 AM
  2. Replies: 0
    Last Post: 7th September 2009, 01:27 PM
  3. HQ video camera
    By ICT_GUY in forum AV and Multimedia Related
    Replies: 2
    Last Post: 24th June 2009, 03:49 PM
  4. Video camera
    By cbolton74 in forum Hardware
    Replies: 1
    Last Post: 14th August 2007, 11:52 PM
  5. Replies: 3
    Last Post: 25th September 2006, 12:27 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •