Batch: Deleting A System Generated Folder.

have a “black box” unit in a vehicle that records digital video onto an SD Card. At the end of each day, the data on the SD Card is to be copied/archived onto a computer’s internal Slave Drive, then the data files contained in the folder “EventList” is to be deleted, while the entire folder and files contained in “FileList … [date/time]”) are to be deleted. Thus, leaving the SD Card will be free to be recorded upon the following day.

Therefore, I want to create a batch file that will accomplish the following tasks:

1) Create a new subfolder on a fixed slave drive [E:\], and name it with the current day’s date (e.g., 11192010)

2) Copy the entire contents of an SD Card [F:\] (i.e., all files and folders) to the newly-created subfolder on the fixed slave drive [E:\].

3) Delete all the files within a folder titled “EventList” on the SD Card [F:\], so that it becomes an empty folder.

4) Completely delete the second folder on the SD Card, which is automatically created/named each day by the hardware (e.g., “FileList_20101117_191021”); this hardware generated name is a combination of the date and time.

I’ve been able to create a batch file that accomplishes the first three tasks, but don’t know how to do the final task (#4 above), since the generated folder name is continually different. Here’s what I have so far:

I was thinking that targeting for deletion folders with the current day’s date as it’s creation date might be the easiest way to do it, as the “EventList” maintains it’s creation date of 11/17/2010, while the “FileList” folder changes each day – the date for the files “drs_config” and “GpsInfo” also changes each day.

Can someone please help me with the final line in the batch file, that will allow me to delete the generated “FileList_(date/time)” folder and all of it’s contents? I would very much appreciate the assistance.

Out of sheer curiosity and because this is something I've always had an interest in doing - what is this black box you have setup? Is it something off the shelf or something you've personally created? Recording actual video/audio or just speed and car data?

The "black box" unit that I am using is called the "Carpa-120". It, like many other similar units, is made in Asia. Unfortunately, the website for the online company from which I purchased the unit is no longer up. However, you might be able to find someone who now carries it by doing an internet search. Alternatively, the manufacturer might be able to direct you to another reseller. Here is the manufacturer's website that I got off the box that the Carpa-120 came in, which has an option to view the website in English:

On the website, you can see not only the specifications of the Carpa-120, but also view a sample of recorded video, and see how to it is installed. You can choose to power it either by your car's cigarette lighter or purchase an optional cable to have it run off your car's engine. I chose the latter and had an auto mechanic do the installation. The audio and video are very clear. It has two cameras: one for the driver's view, and one for the inside of your car. It records onto an SD card, which allows you to transfer the recorded files to a computer for viewing and/or archiving, as well as many other features, such as G-force monitoring and allowing you to see your route in real time playback with Google maps. It comes with a 2GB/class 6 SD card, but you can replace that with up to a 32 GB. A 2GB will get you one hour and twenty minutes of recording time; 4GB is three hours; 8GB six hours, etc. You can set the Carpa-120 to either record continuously, once it it powered on, or only record if the engine is on. It records in three minute blocks, which creates video files of approximately 23GB in size -- you have the option of only recording the driver's view. If the capacity of the installed SD card is reached, the Carpa-120 will then begin overwriting the earliest video files on the SD card. I am very pleased with it. I hope this has helped to answer your question.

The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Compnet Ventures, LLC hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.