이 블로그 검색

목요일, 7월 19, 2012

[MS Windows] net use for map network drive

#net use X: \\[server name]\[shared name]

to remove the map drive,

#net use X: /delete



How do I share a folder?

To create a new local file share, use the following NET SHARE command:
NET SHARE sharename=drive:path /REMARK:"My shared folder" [/CACHE:Manual | Automatic | No ]
This is what it would look like in the real world:
NET SHARE MySharedFolder=c:\Documents /REMARK:"Docs on server ABC"

How do I limit how many users can access my shared folder?

To limit the number of users who can connect to a shared folder, you would use the following NET SHARE command:
NET SHARE sharename /USERS:number /REMARK:"Shared folder with limited number of users"
To remove any limit on the number of users who can connect to a shared folder, use the following:
NET SHARE sharename /UNLIMITED /REMARK:"Folder with unlimited access"
This will allow unlimited number of users to connect to the shared resource.

How do I remove sharing from a folder?

You can accomplish this using the following NET SHARE command again. If you want to delete a share, then execute the following:
NET SHARE {sharename | devicename | drive:path} /DELETE
To delete all shares that apply to a given device, you would use the following:
NET SHARE devicename /DELETE
In this case the devicename can be a printer (Lpt1) or a pathname (for example C:\MySharedFolder\).



Network Drive Mappings and NET USE

The following information pertains to Windows and the SmartBatch 2009 Executive Server running as a Service.
A Service provides a batch logon as opposed to an interactive logon.  An interactive logon provides additional capability such as mapped drives.  If you require the use of network drive letters such as  f:), they must be mapped in an Operation before they are used.  To do this use the NET USE capability.  This can be placed in a .bat file and executed via an Operation or can be placed directly in an Operation.
The following shows the general syntax for the NET USE command:
net use [devicename | *] [\\computername\sharename[\volume]] [password | *]] [/user:[domainname\]
username] [[/delete] | [/persistent:{yes | no}]]
net use devicename [/home[password | *]] [/delete:{yes | no}]
net use [/persistent:{yes | no}]
You can type net use without parameters from a command prompt to obtain a list of network connections.

Examples

Using a .bat file

This example shows how to map three network drives using a .bat file named MyNetUse.bat:
net use o: \\LA\cdrive password /USER:myAccount
net use p:\\NY\cdrive password /USER:myAccount
net use q:\\SF\edrive password /USER:myAccount
The MyNetUse.bat file can be added as an Operation within SmartBatch 2009.

To configure the NET USE capability directly into an Operation

cmd.exe /c net use o:\\LA\cdrive password /USER:myAccount

To delete a drive mapping

net use o: /delete


댓글 없음:

댓글 쓰기