系统:adv win2k
实现目标:局域网两计算机之间的文件实现同步。然后运行同步后的文件
计算机A上放置了文件在目录aaa下xxx.exe,并设置了共享。
计算机B可以登陆计算机A(用户名和密码)。
计算机B上有一个目录BBB下有xxx.exe文件
问题:
现在已经在计算机B上实现自动登陆计算机A并把共享目录映射为计算机B上的一个盘符R:
现在想通过文件比较。只要计算机A上的文件和本地计算机B上的文件不一样就执行copy(日期不一样就可以、还有就是如果本地计算机上没有此文件也拷贝,都是xxx.exe)拷贝完成以后执行xxx.exe。
现在就缺少一个批处理。
如果有了批处理就可以+win的计划任务完成全自动了。
哪位仁兄給写一下批处理。在下谢过了
用fc 和 comp就可以吗!劳驾写出批处理。----------
----------
现在实现了用语句for可以把文件的日期显示出来就是用for /f "skip=3" %a IN ('dir e:\a\xxx.exe') do @if exist %a echo %~ta
可是怎么去比较是不是用set命令。可是我写在批处理里面怎么这些命令就不对了。who知道。
老是报错。可是在命令行下是正常的。
郁闷~~~
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~~~