Often it is quicker and more efficient for the experienced system administrator to configure shares by entering a few quick net share commands at the command prompt. As such, this topic will be covered in detail in this chapter.
The first step in learning to use the net share command is to gain a basic understanding of the command line syntax of the tool. In basic terms, the syntax for net share is as follows:. As illustrated above, many of the tasks which can be performed using the graphical tools can also be performed using the command line. In the remainder of this chapter, some of the more common sharing tasks using net share will be covered. Yes saves all connections as they are made, and restores them at next logon.
No does not save the connection being made or subsequent connections. Existing connections are restored at the next logon. Use net use to connect to and disconnect from a network resource, and to view your current connections to network resources.
You cannot disconnect from a shared directory if you use it as your current drive or an active process is using it. Type net use DeviceName to get information about a specific connection.
Use the same syntax that you use to connect to a Windows Networking server, except you must include the volume you to which you want to connect. If the ServerName that you supply contains spaces, use quotation marks around the text that is, " Server Name ". Enclose the text in quotation marks. Causes the user account to expire if you specify the date. Note that the account expires at the beginning of the specified date.
You can use two or four numbers for the year value. Use commas or slashes to separate parts of the date. Do not use spaces. For example, the following entries are equivalent if entered between Jan.
Sets a path for the user's logon script. Specifies the times that users are allowed to use the computer. You can use hour or hour notation for hours. The value all means a user can always log on. We will start by listing currently existing, joined or mounted remote shares. We will just use net use command like below. We will start with a simple example by mounting a remote file share into our local system.
We will mount file share named Backup which resides at In previous example we have mounted remote file share with the current user and privileges. In some cases we may need to mount with a different user than current session user.
0コメント