System: adv win2k
Goal to achieve: Synchronize files between two computers in the local area network. Then run the synchronized files.
There is a file xxx.exe in directory aaa on Computer A and it is shared.
Computer B can log in to Computer A (with username and password).
There is a file xxx.exe in directory BBB on Computer B.
Problem:
Now automatic login to Computer A has been achieved on Computer B and the shared directory is mapped as a drive letter R: on Computer B.
Now we want to perform copy if the file on Computer A is different from the file on local Computer B (just different dates are okay, and also copy if the file does not exist locally, both are xxx.exe). After copying, execute xxx.exe.
Now only a batch file is missing.
If there is a batch file, it can be combined with Windows scheduled tasks for full automation.
Which gentleman can write the batch file. Thanks in advance.
Can fc and comp be used! Please write the batch file. ------------
------------
Now it is achieved that the date of the file can be displayed using the statement for. That is, use for /f "skip=3" %a IN ('dir e:\a\xxx.exe'
do @if exist %a echo %~ta
But how to compare. But I write these commands in the batch file and they are not correct. Who knows.
Always getting errors. But it is normal in the command line.
Depressed~~~
Goal to achieve: Synchronize files between two computers in the local area network. Then run the synchronized files.
There is a file xxx.exe in directory aaa on Computer A and it is shared.
Computer B can log in to Computer A (with username and password).
There is a file xxx.exe in directory BBB on Computer B.
Problem:
Now automatic login to Computer A has been achieved on Computer B and the shared directory is mapped as a drive letter R: on Computer B.
Now we want to perform copy if the file on Computer A is different from the file on local Computer B (just different dates are okay, and also copy if the file does not exist locally, both are xxx.exe). After copying, execute xxx.exe.
Now only a batch file is missing.
If there is a batch file, it can be combined with Windows scheduled tasks for full automation.
Which gentleman can write the batch file. Thanks in advance.
Can fc and comp be used! Please write the batch file. ------------
------------
Now it is achieved that the date of the file can be displayed using the statement for. That is, use for /f "skip=3" %a IN ('dir e:\a\xxx.exe'
do @if exist %a echo %~taBut how to compare. But I write these commands in the batch file and they are not correct. Who knows.
Always getting errors. But it is normal in the command line.
Depressed~~~

