Sign in to follow this  
Followers 0
d0n

File sync

3 posts in this topic

Hi i am looking to sync 2 files, 1 on my current desktop, the other on a network computer

I have something like this, which works for my current computer. However this won't work if i run the program on the network computer because file paths are different. What is a better way to solve this problem?

If FileGetTime("\\Main0\_main0\__program\Link.db", 0, 1) > FileGetTime("E:\_Backup\_Autoit\Downloader\Link.db", 0, 1) Then
    FileCopy("\\Main0\_main0\__program\Link.db", "E:\_Backup\_Autoit\Downloader\Link.db", 1)
Else
    FileCopy("E:\_Backup\_Autoit\Downloader\Link.db", "\\Main0\_main0\__program\Link.db", 1)
EndIf

Share this post


Link to post
Share on other sites



I would use command line parameters to specify the paths, and make a separate batch file for each machine to launch your script with the correct paths. Alternatively, you could create two separate scripts for each machine.

Share this post


Link to post
Share on other sites

mm nvm apparently this works

\\main2\E (E)\_Backup\_Autoit\Downloader\Link.db
;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0