In your string, "\\" is an escape sequence that turns into "\":
my $DIR; $DIR = '\\ax-risvis447\c$\calc'; print $DIR; # prints "\ax-risvis447\c$\calc" # This gets you the string you want: $DIR = '\\\\ax-risvis447\c$\calc'; print $DIR; # prints "\\ax-risvis447\c$\calc" # And if you want to use double quotes, escape the "$" too: $DIR = "\\\\ax-risvis447\\c\$\\calc"; print $DIR; # prints "\\ax-risvis447\c$\calc"
However, you may still have issues due to shell escapes sometimes being tricky on Windows. For a "cleaner" way to list the files in a directory, see this recent thread for several approaches.
If you still have problems - what happens when you type in dir \\ax-risvis447\c$\calc on the command line?
As a general side note, you should be using use warnings; use strict; at the top of your scripts, to help avoid some common mistakes and typos.
In reply to Re: Access a particular drive on windows server
by Anonymous Monk
in thread Access a particular drive on windows server
by nayabrahil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |