| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| content-class: | urn:content-classes:message |
| MIME-Version: | 1.0 |
| X-MimeOLE: | Produced By Microsoft Exchange V6.0.5762.3 |
| Subject: | Better solution for calling 'net use' from Cygwin Perl? |
| Date: | Wed, 15 May 2002 16:10:00 -0400 |
| Message-ID: | <7BFCE5F1EF28D64198522688F5449D5A0AA30F@xchangeserver2.storigen.com> |
| X-MS-Has-Attach: | |
| X-MS-TNEF-Correlator: | |
| From: | "Scott Prive" <Scott DOT Prive AT storigen DOT com> |
| To: | "Cygwin" <cygwin AT cygwin DOT com> |
| X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id g4FKAdu09896 |
Hello,
I had a .sh script that called Microsoft's "net use" command to mount drives under Win2k, and this worked:
net use 't:' '\\myserver\share'
However I needed to do this in Cygwin Perl so I could leverage an existing set of Perl libraries I have.
For the life of me I could correctly execute the "net use" command from Perl, because the characters would get escaped or not interpreted correctly.
The Perl workaround a coworker devised was:
my $cmd = "net use 't:' '\\";
$cmd .= "\\storigen1u21\\sfstest'";
print $cmd;
system $cmd;
and this DOES work. This would be the end of story, except we want to understand what caused the problem in the first place. I suspect it was the brain dead Microsoft command processor getting involved with this system call.
Anyone care to elaborate? Thanks,
Scott
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |