Re: Watch Folder by Blinky
Blinky
Fri Apr 08 08:35:09 CDT 2005
"McKirahan" <News@McKirahan.com> wrote in message
news:nNednU-GyNfI6sjfRVn-vw@comcast.com...
> "Blinky" <xxnospamxxweh@bigpond.net.au> wrote in message
> news:JEc5e.3208$5F3.1400@news-server.bigpond.net.au...
>> Thanks for your reply,
>>
>> I suppose it will be a never ending prog. At least till the machine is
>> shutdown !
>>
>> I am trialling an idea for a digital camera that has wireless networking
>> built in. The camera transmits to a wireless enabled laptop where the
> images
>> drop into a 'watch' folder. A script on the laptop then picks up these
>> images, applies a generic caption then FTP's them via an internet
> connection
>> (high speed 3G data card) to a remote location.
>>
>> It would have to do this over a 2 hour period. The length of a sporting
>> event.
>>
>> I have found a command line tool for adding the IPTC (caption) info.
> CuteFTP
>> Pro is scriptable. All I need is to create the script to do that watching
>> and processing.
>>
>> I don't it would not matter if the script ran until the laptop was
> shutdown.
>>
>> Cheers, Bill.
>>
>>
>>
>> "McKirahan" <News@McKirahan.com> wrote in message
>> news:0_2dnfTtXZ9yzsjfRVn-vw@comcast.com...
>> > "Blinky" <xxnospamxxweh@bigpond.net.au> wrote in message
>> > news:Cbc5e.3191$5F3.1088@news-server.bigpond.net.au...
>> >> Hi all,
>> >>
>> >> I want to write a VB Script that will watch a folder. When a file is
>> > dropped
>> >> into it, the script performs a few functions on it then moves the file
>> >> out.....eventually by FTP.
>> >>
>> >> Is this possible and how ?
>> >>
>> >> Thanks to whoever maybe of assistance
>> >>
>> >> Bill.
>> >
>> >
>> > Should it be a Never Ending Program or do you
>> > want to run it periodically, say every 5 minutes?
>
> [snip]
>
> Please don't top post as it's harder to follow the conversation.
>
> You didn't comment on the script I posted so here it is again;
> but this version runs every minute until it's stopped.
>
> Option Explicit
> '*
> Const cVBS = "WatchFolder.vbs"
> Const cFOL = "D:\Temp\"
> Const cSEC = 60 '= seconds to Sleep
> '*
> Do
> Dim objFSO
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> If Not objFSO.FolderExists(cFOL) Then WScript.Quit
> Dim objGFO
> Set objGFO = objFSO.GetFolder(cFOL)
> If objGFO.Files.Count = 0 Then Exit Do
> Dim objGFI
> Set objGFI = objGFO.Files
> Dim strGFI
> For Each strGFI in objGFI
> Call Transfer(strGFI.Name)
> Next
> Set objGFI = Nothing
> Set objGFO = Nothing
> Set objFSO = Nothing
> WScript.Sleep 1000 * cSEC
> Loop
>
> Sub Transfer(filename)
> WScript.Echo cFOL & filename
> End Sub
>
>
Thanks McKirahan,
That's along the lines of what I though was going to be my solution.
Cheers, Bill.