use Filesys::SmbClient; my $smb = Filesys::SmbClient->new( username => $user, password => $pwd, workgroup => $workgroup, debug => $debug, ); my $fd = $smb->opendir("smb://filer1/db_backups\$/rest") or die "$!\n"; #### print "[$host], [$share], [$dir], [$user], [$pwd], [$workgroup], [$debug]\n"; # change share name from share$ to share\$ if ( $share =~ m/^.*\$$/ ) { $share =~ s/\$/\\\$/g; print "share is [$share]\n"; } else { print "share is $share\n"; } my $full_path = 'smb://' . $host . '/' . $share . '/' . $dir ; print "[$full_path]\n"; my $fd = $smb->opendir("$full_path") or die "$!\n"; #### [filer1], [db_backups$], [rest], [user], [password], [workgroup], [100] share is [db_backups\$] Full path is [smb://filer1/db_backups\$/rest] No such file or directory