Jump to content

Recommended Posts

Posted

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
Posted

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.

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
×
×
  • Create New...