I wrote a VBScript to monitor my Video Capture folder put the date and time at the begining and move it to another folder. What I need is to run the Script every 60 seconds. My Script is below. I want to use this in conjunction with ProCoder folder watch.
---Start Script------
dim oldname
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("d:\video")
For Each file In f.Files
if right(file,3)="avi" then
oldname=file.name
dim fname
Dim sSourceFile
Dim sDestinationFile
TheDay = Weekday(now)
TheYear = year(now)
TheMon = month(now)
TheHour= hour(now)
TheMinute=minute(now)
theSecond=second(now)
fname = Themon & "-" & TheDay & "-" & TheYear & "-" & "T" & thehour & theminute & thesecond & "-" & oldname
file.name = fname
sSourceFile = "d:\video\" & fname
sDestinationFile = "d:\ENCODE\xvcd\" & fname
FSO.MoveFile sSourceFile, sDestinationFile
end if
Next
---End Script------
+ Reply to Thread
Results 1 to 10 of 10
-
-
Windows scheduled tasks can do it for you every minute.
Set it up to run (once) daily:
Then use the Advanced button to set it to repeat every minute for 24 hours:
This then adjusts it so that it runs every 1 minute for 24 hours every day (of the week) and it's reflected here:
Job's rightIf in doubt, Google it. -
jimmalenko,
Don't mine at all. I know there is a way to make it recursive... For Now I will use the scheduler.
BTW Thanks the scheduler will do for now. -
What is the wrapper going to be for this script? The ways I can think of to do this is a) write a windows service that runs as either manual or automatic, and runs the script based on a timer event, or b) either an executable or web page wrapper that contains an Active X timer object and calls the script on the timer interval event.
If either of those sound reasonable, let me know and I can help. -
tekkieman
My Intention was to simply double click the Script and have it run.... but I like your Idea to run as a system service. I can create an executable in visual basic...but I really didn't want to go that route. The Scheduler works fine. I want to keep it simple.
If a System Service is do-able let me know thx. -
You should still be able to create a reference to a timer object:
Code:<OBJECT classid="clsid:59CCB4A0-727D-11CF-AC36-00AA00A47DD2" id=timer1 <param name="Interval" value="60000"> <param name="enabled" value="-1"> </OBJECT> sub timer1_timer 'call your script. end sub
-
Ok, forget all that!
Let's keep it real simple. Here is your code with one line added.
Code:dim oldname do WScript.sleep(60 * 1000) Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder("d:\video") For Each file In f.Files if right(file,3)="avi" then oldname=file.name dim fname Dim sSourceFile Dim sDestinationFile TheDay = Weekday(now) TheYear = year(now) TheMon = month(now) TheHour= hour(now) TheMinute=minute(now) theSecond=second(now) fname = Themon & "-" & TheDay & "-" & TheYear & "-" & "T" & thehour & theminute & thesecond & "-" & oldname file.name = fname sSourceFile = "d:\video\" & fname sDestinationFile = "d:\ENCODE\xvcd\" & fname FSO.MoveFile sSourceFile, sDestinationFile end if Next loop
Similar Threads
-
Removing the first 18 seconds of a video
By Simmons in forum Video ConversionReplies: 9Last Post: 14th Jun 2011, 05:18 -
delete sound between x seconds and y seconds?
By charlieship in forum Newbie / General discussionsReplies: 3Last Post: 4th Jun 2011, 22:14 -
Plays only a few seconds
By Shaorin in forum Newbie / General discussionsReplies: 1Last Post: 30th Dec 2009, 08:26 -
Add seconds on to track?
By sbuckmybballs in forum AudioReplies: 4Last Post: 23rd Dec 2007, 20:35 -
Processing done in seconds then error
By error in forum SVCD2DVD & VOB2MPGReplies: 1Last Post: 22nd Jul 2007, 17:44