X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave.korn@artimi.com>
To: <cygwin@cygwin.com>
References:  <mn.9b2e7d74755eba61.51129@pbs.org>
Subject: RE: Mapping windows drives in cygwin?
Date: Thu, 19 Apr 2007 18:47:03 +0100
Message-ID: <009301c782aa$bd66ca70$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
Content-Type: text/plain; 	charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To:  <mn.9b2e7d74755eba61.51129@pbs.org>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@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

On 19 April 2007 18:35, Kevin Markle wrote:

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

  You can invoke the standard "net use" command with only the slight
complication of having to either escape or quote the backslashes, or use
forward slashes.  Examples: (slightly forged, for privacy reasons)

/tmp $ net view \\\\tinytim
Shared resources at \\tinytim

Share name         Type  Used as  Comment

-----------------------------------------------------------------------------
all-homes          Disk  S:       all-homes on Tinytim
arch_preambles     Disk           Architecture data sets
cad                Disk           CAD installation directory
hardware           Disk
lab                Disk  O:
sys_test           Disk           System test
sysadmin           Disk
~dk                Disk           Home Directory
The command completed successfully.

/tmp $ net view '\\tinytim'
Shared resources at \\tinytim



Share name         Type  Used as  Comment

-----------------------------------------------------------------------------
all-homes          Disk  S:       all-homes on Tinytim
arch_preambles     Disk           Architecture data sets
cad                Disk           CAD installation directory
hardware           Disk
lab                Disk  O:
sys_test           Disk           System test
sysadmin           Disk
~dk                Disk           Home Directory
The command completed successfully.

/tmp $ net use  X: '\\tinytim\sysadmin'
The command completed successfully.

/tmp $ ls /cygdrive/x
Bakbone                             NetApp
Certance                            Network Diagrams
Cisco                               Phaser7300DN_SpecialPrint.pdf
Correspondence                      SNAP
IM845G Motherboard Users Guide.pdf  Software_Licensing
Installs                            tmp
Manuals                             tmpbkup
MySQL                               winventory



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/

