Duplicating files - win7

Page may contain affiliate links. Please see terms for details.

MrJamie

Oaf on a Bike
[QUOTE 2314447, member: 9609"]Thanks for all the different angles - haven't used bat files for a very long time, in fact forgot they existed - may be one fired by scheduler may be a solution. However I don't see any real advantage over what I am using now in excel. I was hoping I could just attach an event to the creation or modification of the .kml that I am dealing with.[/quote]

I've had a bit of a play and it seems the link method I mentioned before works exactly like I think you would want it to.

Run an elevated command prompt and type: mklink <location of link> <location of file>
eg: mklink c:\cloudthings\document1.kml c:\users\Reiver\documents\document1.kml

It's effectively having your file exist in both folders at once, but there's still only 1 version of it, you can open/edit/save it from either place. It'll always be the same version of the same file in both places, so no need to sync/schedule anything. When you upload your cloud stuff it should take it fine from the cloud folder and when you open it from the documents folder that should work fine too, 1 file, 2 places essentially. I've done a little test and on my PC at least there's no problem accessing it from one place while the other is open in excel. Assuming it works as well as I think it will, it's the most tidy solution by far :smile:
 
I've not heard of the mklink so will look that up later too!

As I suggested earlier, if you want two separate files, you'd need to have some sort of polling of the folder looking for a change in the date. Rather than having this running constantly, you could use a powershell script (I much prefer these to batch as more powerful). Rather than opening the file, run a powershell script that would open the file for you. It would then start the polling the original folder at intervals of your choosing (every minute?) looking for a change in the date of the file you have opened. As soon as it sees the changes, it would robocopy the file to the 2nd location. Then, when you are done and have closed the file, you can then close the powershell script so it will stop polling the folder which is ultimately taking up resources.

OR - and this would be easier!
change the subs in excel to auto_open and auto_close
Don't open your file, but open the excel file. The auto_open in Exel can then open the file automatically for you.
When you are done, close your file and close the excel fiel. Excel will have another sub called auto_close that does the copying as you've already written - it will be trigged automatically when you clsoe the excel file
 
I've used a bit of software called Allway Sync to do exactly what you want , in my case between a main PC, a Network storage device, USB stick and a laptop. Works in either direction so it doesn't matter which device has the most recent file, the others will be updated. Can be set to do this automatically at specific times or time intervals.

http://allwaysync.com/

The free version is only limited in the number of files it will synchronize, its a lot but in the end I went with the paid version for the sheer volume of files I have synced.
 
Top Bottom