in reply to Access a particular drive on windows server

Good day nayabrahil

As far as I know, the DIR command does not support UNC file paths. You will most likely need to map that path to a drive letter on your machine.

Alternatively I located a library that seems to work by mapping the UNC path to a temporary location.

use strict; use warnings; use File::pushd; my $TEMP_DIR_OF_UNC = pushd( '\\AX-RISCVMCRYS02\C$\CALC' ); print "Temporary mapping of UNC path is : $TEMP_DIR_OF_UNC\n"; system('DIR '.$TEMP_DIR_OF_UNC);

I suggest reading over the manual page for the Pushd library. There are some usage gotcha's in there.

http://search.cpan.org/~dagolden/File-pushd-1.006/lib/File/pushd.pm

I hope this helps.

Replies are listed 'Best First'.
Re^2: Access a particular drive on windows server
by nayabrahil (Novice) on May 08, 2014 at 07:33 UTC

    Awesome monks you people are doing a wonderful job. God knows what will happen to perl developers without you people.

    I will try the above method and will let you know if it works for me. Thanks again.