Use NET command to synchronize local area network files with batch update

Source: Internet
Author: User
Tags connect net command resource

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.