Now everyone wants to have a sync software to meet the network directory or file updates to reduce their workload, now there are a lot of software on the network to achieve this goal, such as synchronization experts, but these software needs to install the server and client, the client to resident to use, and occupy a certain amount of resources.
The following batch uses NET commands to update files and directories synchronously. The advantage is that any machine can do the server and the client, and does not occupy any resources. Of course, the disadvantage is to write batch processing a bit annoying ^ ^.
I first write the batch and then explain it in detail:
NET use s:computer-01d
Attrib-s-h-r s:ghostc:windowscommandxcopy.exe/s/e/y
D:ghost S:ghost
NET use */delete
NET use s:computer-02d
Attrib-s-h-r S:ghost
c:windowscommandxcopy.exe/s/e/y d:ghost S:ghost
NET use */delete
Write a description of the use of the Net command, which uses the net command one of the parameters net
Use, if interested in other, you can play net/in command window? Displays its help screen.
Parameter net use
Role: Connect the computer or disconnect the computer from the shared resource, or display the connection information for the computer.
Command format: NET USE [DeviceName | *] [Computernamesharename[volume]]
[Password | *]] [/user:[domainname]username] [[/delete] |
[/persistent:{yes | no}]]
Parameter introduction:
Type net use with no parameters to list network connections.
DEVICENAME Specifies the name of the resource to which you want to connect or the name of the device to disconnect.
Computernamesharename the name of the server and the shared resource.
Password The password to access the shared resource.
* Prompt to type password.
/USER Specifies a different user to connect to.
domainname specifies another domain.
USERNAME Specifies the user name for the login.
/home connects users to their host directory.
/delete Cancel the specified network connection.
/persistent controls the use of permanent network connections.
The following is a simple example of a description:
(1) net use e:yfangtemp the Yfangtemp directory to set up e-disk
(2) net use E:yfangtemp/delete disconnect
Here I only write two lines of batch processing, meaning that the two major lines of network identity are different, others can be followed by analogy. My Internet Café Network logo is computer-01~computer-n
The network name of Internet Café Computer, can change according to own actual situation. such as User01~userxx
Begin to explain each line of command, the actual application will be explained later.