This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Mapping windows drives in cygwin?


Kevin Markle wrote:
Hello,

Does anybody know of a simple way to map network drives from withing a cygwin script? :o)

Hi Kevin,


This method works:


#====Using a hostname for the remote machine===== net use \\\\sandstone.bedrock.net\\IPC$ /user:bedrock\\fflintstone /persistent:no (You'll be prompted for a password)


#====Using an IP address for the remote machine===== net use \\\\192.168.2.100\\IPC$ /user:bedrock\\fflintstone /persistent:no (You'll be prompted for a password)


#=====Map drive Z: to the C: drive on the remote server===== net use z: \\\\sandstone.bedrock.net\\C$ --or-- net use z: \\\\192.168.2.100\\C$

ls -latr /cygdrive/z (get a directory listing on the mapped drive)


The first line sets up an IPC channel to the server you're interested in mapping to. The second maps drive Z: to the C: share.

To UNMAP, use this syntax, just as in CMD.EXE.

net use Z: /delete



=========Keith

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]