X-Spam-Check-By: sourceware.org
X-YMail-OSG: OMQPf3oVM1ls9oUGWNNNsbpNCr3p.Q3wammeDpCiGzLmzKBIxTYWexX2Ao60YN3xHyboxJUg2Q--
Message-ID: <4627F4E8.2020903@yahoo.com>
Date: Thu, 19 Apr 2007 17:02:00 -0600
From: Keith Christian <keithchristian@yahoo.com>
User-Agent: Debian Thunderbird 1.0.2 (X11/20070113)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Mapping windows drives in cygwin?
References: <mn.9b2e7d74755eba61.51129@pbs.org>
In-Reply-To: <mn.9b2e7d74755eba61.51129@pbs.org>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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/

