Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - windows events

Reply
 
Old 01-03-2009   #1 (permalink)
arno


 
 

windows events



Hi,

I am about to develop a WSH script that will compare files (office
templates) in a central storage location to local files, and copy them
to the local system if necessary. Lots of users, heterogenous setup OS-
wise.

There are quite a lot of files to compare (>300). and some of them are
rather big (>3MB). Copying them over a VPN connection will take a bit of
time.

The script will be started from VBA code using a timer.

The idea is to have local user templates be updated without user-
intervention and without disruption of the users normal routines.

The script will essentially be a recursive algorhythm that will compare
files on the server to files on the local system, and copy them if the
files on the server are newer (in essence, a one-way syncing mechanism).

Since it can potentially involve heavy copying, I am worried about what
happens if a user shuts the system down.

1. What happens if a FileCopy operation is in progress?
2. what happens if the scripts routine (compare/(copy)/recurse) is still
in progress?

As to 1., will the operation be aborted, potentially leaving the user
with a corrupted new copy of a file?
As to 2., is there a way to do something like 'windows is shutting down
event so exit'? Is it needed?

Any thoughts are much appreciated,

TIA,
arno

My System SpecsSystem Spec
Old 01-03-2009   #2 (permalink)
Paul Randall


 
 

Re: windows events


"arno" <noreplyAThighiqDOTnl@xxxxxx> wrote in message
news:MPG.23ca2692e78a0396989682@xxxxxx
Quote:

>
>
> Hi,
>
> I am about to develop a WSH script that will compare files (office
> templates) in a central storage location to local files, and copy them
> to the local system if necessary. Lots of users, heterogenous setup OS-
> wise.
>
> There are quite a lot of files to compare (>300). and some of them are
> rather big (>3MB). Copying them over a VPN connection will take a bit of
> time.
>
> The script will be started from VBA code using a timer.
>
> The idea is to have local user templates be updated without user-
> intervention and without disruption of the users normal routines.
>
> The script will essentially be a recursive algorhythm that will compare
> files on the server to files on the local system, and copy them if the
> files on the server are newer (in essence, a one-way syncing mechanism).
>
> Since it can potentially involve heavy copying, I am worried about what
> happens if a user shuts the system down.
>
> 1. What happens if a FileCopy operation is in progress?
> 2. what happens if the scripts routine (compare/(copy)/recurse) is still
> in progress?
>
> As to 1., will the operation be aborted, potentially leaving the user
> with a corrupted new copy of a file?
> As to 2., is there a way to do something like 'windows is shutting down
> event so exit'? Is it needed?
>
> Any thoughts are much appreciated,
>
> TIA,
> arno
I have a comment about the comparison problem:

Why not set up a script on all of the machines that will create a table of
checksums for all these files of interest on the system; they might update
the checksums on a regular basis or on demand from a central location. This
would require minimal bandwidth and would spread the bulk of the CPU
requirements to minimize the impact on any one system. Then your script
would only have to compare the table entries for the files in question and
only copy those files that are out of date. I think Microsoft's Capicom
object is scriptable and will create CRC32 and MD5 checksums, and is freely
downloadable to those machines on which it does not already reside.
http://www.microsoft.com/downloads/r...DisplayLang=en

-Paul Randall


My System SpecsSystem Spec
Old 01-13-2009   #3 (permalink)
Chip Orange


 
 

Re: windows events

You don't really need to reinvent the wheel; MS has both XCopy and Robocopy
utilities, which will copy based on newer dates, to do this kind of thing
for you.

I believe they handle the situation where the copy was not allowed to
complete properly; however, if you must do this yourself, copy the file to a
temporary directory on the same drive as your destination file, and when the
copy is complete, delete the destination file and rename the copy in the
temp directory to the name of the destination file.

hth,

Chip


"arno" <noreplyAThighiqDOTnl@xxxxxx> wrote in message
news:MPG.23ca2692e78a0396989682@xxxxxx
Quote:

>
>
> Hi,
>
> I am about to develop a WSH script that will compare files (office
> templates) in a central storage location to local files, and copy them
> to the local system if necessary. Lots of users, heterogenous setup OS-
> wise.
>
> There are quite a lot of files to compare (>300). and some of them are
> rather big (>3MB). Copying them over a VPN connection will take a bit of
> time.
>
> The script will be started from VBA code using a timer.
>
> The idea is to have local user templates be updated without user-
> intervention and without disruption of the users normal routines.
>
> The script will essentially be a recursive algorhythm that will compare
> files on the server to files on the local system, and copy them if the
> files on the server are newer (in essence, a one-way syncing mechanism).
>
> Since it can potentially involve heavy copying, I am worried about what
> happens if a user shuts the system down.
>
> 1. What happens if a FileCopy operation is in progress?
> 2. what happens if the scripts routine (compare/(copy)/recurse) is still
> in progress?
>
> As to 1., will the operation be aborted, potentially leaving the user
> with a corrupted new copy of a file?
> As to 2., is there a way to do something like 'windows is shutting down
> event so exit'? Is it needed?
>
> Any thoughts are much appreciated,
>
> TIA,
> arno

My System SpecsSystem Spec
Old 01-13-2009   #4 (permalink)
arno


 
 

Re: windows events

Tx. Didn't know abt robocopy. Seems like that would be the tool of
choice for this, but it seems it is Vista-specific (would require
additional install on XP?) By now I've already written a util :-) It
does indeed use a temporary filename.

arno


In article <uPplj8adJHA.1916@xxxxxx>,
Chip.Orange@xxxxxx says...>
Quote:

> You don't really need to reinvent the wheel; MS has both XCopy and Robocopy
> utilities, which will copy based on newer dates, to do this kind of thing
> for you.
>
> I believe they handle the situation where the copy was not allowed to
> complete properly; however, if you must do this yourself, copy the file to a
> temporary directory on the same drive as your destination file, and when the
> copy is complete, delete the destination file and rename the copy in the
> temp directory to the name of the destination file.
>
> hth,
>
> Chip
>
>
> "arno" <noreplyAThighiqDOTnl@xxxxxx> wrote in message
> news:MPG.23ca2692e78a0396989682@xxxxxx
Quote:

> >
> >
> > Hi,
> >
> > I am about to develop a WSH script that will compare files (office
> > templates) in a central storage location to local files, and copy them
> > to the local system if necessary. Lots of users, heterogenous setup OS-
> > wise.
> >
> > There are quite a lot of files to compare (>300). and some of them are
> > rather big (>3MB). Copying them over a VPN connection will take a bit of
> > time.
> >
> > The script will be started from VBA code using a timer.
> >
> > The idea is to have local user templates be updated without user-
> > intervention and without disruption of the users normal routines.
> >
> > The script will essentially be a recursive algorhythm that will compare
> > files on the server to files on the local system, and copy them if the
> > files on the server are newer (in essence, a one-way syncing mechanism).
> >
> > Since it can potentially involve heavy copying, I am worried about what
> > happens if a user shuts the system down.
> >
> > 1. What happens if a FileCopy operation is in progress?
> > 2. what happens if the scripts routine (compare/(copy)/recurse) is still
> > in progress?
> >
> > As to 1., will the operation be aborted, potentially leaving the user
> > with a corrupted new copy of a file?
> > As to 2., is there a way to do something like 'windows is shutting down

My System SpecsSystem Spec
Old 01-14-2009   #5 (permalink)
Chip Orange


 
 

Re: windows events

I believe robocopy is available for xp, but it is a separate download as you
say (I think it's in the xp resource kit).

still, it does so much it's worth pushing out (there's no installation, just
copy it to some directory on the path, that's it). So you add one line to
copy it to your script, then from then on you can use robocopy to copy the
templates.


"arno" <noreplyAThighiqDOTnl@xxxxxx> wrote in message
news:MPG.23d7043ec2f481a2989688@xxxxxx
Quote:

> Tx. Didn't know abt robocopy. Seems like that would be the tool of
> choice for this, but it seems it is Vista-specific (would require
> additional install on XP?) By now I've already written a util :-) It
> does indeed use a temporary filename.
>
> arno
>
>
> In article <uPplj8adJHA.1916@xxxxxx>,
> Chip.Orange@xxxxxx says...>
Quote:

>> You don't really need to reinvent the wheel; MS has both XCopy and
>> Robocopy
>> utilities, which will copy based on newer dates, to do this kind of thing
>> for you.
>>
>> I believe they handle the situation where the copy was not allowed to
>> complete properly; however, if you must do this yourself, copy the file
>> to a
>> temporary directory on the same drive as your destination file, and when
>> the
>> copy is complete, delete the destination file and rename the copy in the
>> temp directory to the name of the destination file.
>>
>> hth,
>>
>> Chip
>>
>>
>> "arno" <noreplyAThighiqDOTnl@xxxxxx> wrote in message
>> news:MPG.23ca2692e78a0396989682@xxxxxx
Quote:

>> >
>> >
>> > Hi,
>> >
>> > I am about to develop a WSH script that will compare files (office
>> > templates) in a central storage location to local files, and copy them
>> > to the local system if necessary. Lots of users, heterogenous setup OS-
>> > wise.
>> >
>> > There are quite a lot of files to compare (>300). and some of them are
>> > rather big (>3MB). Copying them over a VPN connection will take a bit
>> > of
>> > time.
>> >
>> > The script will be started from VBA code using a timer.
>> >
>> > The idea is to have local user templates be updated without user-
>> > intervention and without disruption of the users normal routines.
>> >
>> > The script will essentially be a recursive algorhythm that will compare
>> > files on the server to files on the local system, and copy them if the
>> > files on the server are newer (in essence, a one-way syncing
>> > mechanism).
>> >
>> > Since it can potentially involve heavy copying, I am worried about what
>> > happens if a user shuts the system down.
>> >
>> > 1. What happens if a FileCopy operation is in progress?
>> > 2. what happens if the scripts routine (compare/(copy)/recurse) is
>> > still
>> > in progress?
>> >
>> > As to 1., will the operation be aborted, potentially leaving the user
>> > with a corrupted new copy of a file?
>> > As to 2., is there a way to do something like 'windows is shutting down
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
can windows 2, 3, and 4 send events to window 1 .NET General
Windows Firewall Security Events When F/W Off System Security
Windows calendar recurring events Vista General
How do i set up recurring events in Windows Calendar Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46