![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
| | #5 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||