How to export data in folders?
November 20, 2005 9:06 AM   Subscribe

Is there a way in Windows XP Pro where I can set up a folder to automatically export the data that Ive put into it, when it reaches a certain size?

Ive subscribed to a number of Podcasts, as this is the new hip thing to do, however I've not got an Ipod or MP3 player, but I have got an mp3 CD player.
So I was wondering if I was able to set a folder up that would fill up to about the size of a CD, and then export this data into another folder, which I could then burn and listen to?
I know this is easily done manually but was just hoping there was a cheeky shortcut that I could use instead.
posted by djstig to Computers & Internet (4 answers total)
 
I've never used this application, but it might do what you're looking for.

You could also write a small script that you could attach to a scheduled task that could check the folder size each hour (or for whenever you specify) and then copy the folder contents over to your burn folder. I'm not sure of what your proficiency is with Windows so I haven't provided the script code here. Let me know if you want it.
posted by purephase at 9:29 AM on November 20, 2005


Response by poster: Oh cheers I've downloaded that program, but I was thinking more of a script thingy.

Any one else got any ideas?

Cheers
posted by djstig at 3:34 AM on November 21, 2005


Best answer: Copy/paste the following into a file called "ManageFolder.wsf" (using notepad -- without quotes):

<package>
<job id="manage_folder">
<script language="vbscript">

Option Explicit
On Error Resume Next

Dim strFolderToMonitor, strFolderToCopyTo, intFileSizeLimit

' Only change these variables.
strFolderToMonitor = "<PATH>" ' Full path to the folder to monitor. (eg. c:\original) -- DO NOT USE A TRAILING SLASH!
strFolderToCopyTo = "<PATH>" ' Full path to the destination folder. The files from the above folder will be copied here. Same format as above.
intFileSizeLimit = 700 ' The maximum file size in MB. Once the contents of the original folder reach this size, they will be copied over.

' Declare objects.
Dim FSO: Set FSO = CreateObject("Scripting.FileSystemObject")

' Check to see if the source and destination folders exist.
If FSO.FolderExists(strFolderToMonitor) And FSO.FolderExists(strFolderToCopyTo) Then
Dim FolderToMonitor

Set FolderToMonitor = FSO.GetFolder(strFolderToMonitor)

' Check the folder size. It's returned in bytes so convert it to match MB value above.
If FolderToMonitor.Size >= (intFileSizeLimit * 1024) * 1024 Then
Dim File

' The folder size was greater than fileSizeLimit specified, copy each of the files from the original folder over to the destination.
For Each File in FolderToMonitor.Files
File.Copy(strFolderToCopyTo & "\")

If Not Err Then
' The file was successfully copied, delete it from the original folder.
File.Delete
End If
Next
End If

Set FolderToMonitor = Nothing
End If

Set FSO = Nothing
WScript.Quit
</script>
</job>
</package>

Once you have it in notepad, change the strFolderToMonitor variable to match the folder you want to copy the files from, where the strFolderToCopyTo is your destination (burn folder).

Once the ManageFolder.wsf file is saved copy/paste the following into a .bat file (using notepad):

cscript ManageFolder.wsf

Make sure that both files are in the same folder (I would recommend a separate folder from either the monitored folder or the destination folder).

Setup a scheduled task (Start->Settings->Control Panel->Scheduled Tasks) that runs the batch file (the second file you created) at a specified time interval (hourly, daily etc). You shouldn't have to dig too deeply into any of the advanced settings for the scheduled task for this to work properly.

If you have any problems, let me know.
posted by purephase at 5:32 AM on November 21, 2005


Response by poster: Ohh ta very much, I'll have a fiddle with that.
posted by djstig at 7:16 AM on November 21, 2005


« Older Most annoying ringtone!   |   How can I get my 1.5 year old dog trained!? Newer »
This thread is closed to new comments.