Mapping windows drives in cygwin?

Dave Korn dave.korn@artimi.com
Thu Apr 19 17:47:00 GMT 2007


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/



More information about the Cygwin mailing list