This is the mail archive of the cygwin@cygwin.com 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: Better solution for calling 'net use' from Cygwin Perl?


Scott, et al --

...and then Scott Prive said...
% 
% Hello,

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'

Makes sense.


% 
% 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.

I take it you mean you *couldn't*, right?


% 
% 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.

I hate to be picky, but it's worth checking since it certainly ought to
work.  Did you try

  my $cmd = "net use 't:' '\\\\storigen1u21\\sfstest'";

in the course of your efforts?


% 
% Anyone care to elaborate? Thanks,

HTH & HAND


% 
% Scott


:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) davidtg@justpickone.org * than to live up to them. -- fortune cookie
(work) davidtgwork@justpickone.org
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg00958/pgp00000.pgp
Description: PGP signature


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