help chdir UNC path ( newbie )

D

Didier FRAISSE

i'm trying to convert this small ruby script into perl script

Reporting.rb
========
Dir.chdir('\\\Bureautique\Reporting France')
system( 'C:\Program Files\Microsoft Office\Office\Excel.exe "Reporting
France.xls"')
Dir.chdir('\\\Bureautique\Reporting Export')
system( 'C:\Program Files\Microsoft Office\Office\Excel.exe "Reporting
Export.xls"')

Reporting.pl
========
chdir('\\\Bureautique\Reporting France')
system( 'C:\Program Files\Microsoft Office\Office\Excel.exe "Reporting
France.xls"')
chdir('\\\Bureautique\Reporting Export')
system( 'C:\Program Files\Microsoft Office\Office\Excel.exe "Reporting
Export.xls"')

but it seems that UNC path are not welcome !!!
how can i do the same in perl

thanks
Didier
 
D

Didier FRAISSE

Thanks for your answer

my first problem is with chdir it seems that it doesn't support UNC path
use strict;
use warnings;
chdir('\\\Bureautique\Reporting France');
system( 'dir');

the result is soething like

CMD.EXE was started up, with '\\Bureautique\Reporting France' as a way of
catalog accesses in course. The accesses ways UNC are not taken charge of.
Usage of the catalog Windows by default.
 
D

Didier FRAISSE

Didier FRAISSE said:
i'm trying to convert this small ruby script into perl script

Reporting.rb
========
Dir.chdir('\\\Bureautique\Reporting France')
system( 'C:\Program Files\Microsoft Office\Office\Excel.exe "Reporting
France.xls"')
Dir.chdir('\\\Bureautique\Reporting Export')
system( 'C:\Program Files\Microsoft Office\Office\Excel.exe "Reporting
Export.xls"')

Reporting.pl
========
chdir('\\\Bureautique\Reporting France')
system( 'C:\Program Files\Microsoft Office\Office\Excel.exe "Reporting
France.xls"')
chdir('\\\Bureautique\Reporting Export')
system( 'C:\Program Files\Microsoft Office\Office\Excel.exe "Reporting
Export.xls"')

but it seems that UNC path are not welcome !!!
how can i do the same in perl

thanks
Didier
Grace to your assistance, i solve my problem easily.

my $Path = '\\\\Bureautique\\Reporting France\\';
my $xlsFile = 'Reporting France.xls';
my $Program = '"C:\\Program Files\\Microsoft Office\\Office\\Excel.exe"';
my $Command = $Program.' "'.$Path.$xlsFile.'"' ;

system( $Command );

no needs of chdir !!
it was just à matter of slashes and quotes and double quote

many thanks for all of you
Didier
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,142
Messages
2,570,818
Members
47,362
Latest member
eitamoro

Latest Threads

Top