[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-admin
Subject:    RE: Unable to map hidden shares
From:       Eric.Buller () lrcc ! on ! ca
Date:       2000-09-29 19:37:03
[Download RAW message or body]

Albert,

Are you missing a \ in the @Paths statement?

Should it be @Paths = (''\\\\nt01\\c\$\\program files")?

Eric Buller







albert lazo <alazo1@yahoo.com> on 09/29/2000 03:01:57 PM
                                                                                
                                                                                
                                                                                


                                                              
                                                              
                                                              
 To:      "EDWARDS, John" <Edwardsj@oup.co.uk>,               
          "'perl-win32-admin@listserv1.ActiveState.com'"      
          <perl-win32-admin@listserv1.ActiveState.com>        
                                                              
 cc:      (bcc: Eric Buller/Lrcc)                             
                                                              
                                                              
                                                              
 Subject: RE: Unable to map hidden shares                     
                                                              







Here is the whole script. Note that this works when
not mapping a hidden share which is why I thought that
the problem was in the '$'.

I have tried to map this from NT's Explorer but does
not work (only goes up to the c$). In W2k it does work
which is why I'm running the script from my w2k box.

Also I have tried to just map "\\\\server\\c\$" but
does not work.

The scripts retrieves files from the network and
copies the ones that meet the criteria into another
folder, then renames it.
Thanks in advance for your help

#!/usr/bin/perl-w

use Win32::FileOp;
use Win32::AbsPath;
use File::Copy;
use File::Find;

@Paths = ("\\\\nt01\c\$\\Progam Files");

Disconnect h ;
foreach $Pa(@Paths) {
     if(Map h =>$Pa) {
          print "\n";
          print "$Pa \n" ;
          sleep(5);
          chdir "h" ;\
          @Files = <h:\\*.txt>;
          foreach $Filer(@Files) {
               open(FILE,"$Filer");
               read(FILE,$text, 265);
               if($text =~ /July 28,/i) {
                    close(FILE);
                    open(FILE, "$Filer") ;
                    while(<FILE>) {
                         chomp;
                         if ($_ =~/Job name:/) {
                              ($One, $Two, $Three, $Four)= split/ /;
                              close(FILE);
                              copy $Filer, "c:\\perl\\PreDump";
                              chdir "c:\\perl\\PreDump";
                              sleep(2);
                              $Filer =~tr/h:\\//d ;
                              find(\&wanted, "c:\\perl\\PreDump");
                              sub wanted {
                              if(/.txt/) {
                                   rename "$Filer", "$Three.txt" ;
                              }
                              }
                              print "$Three has been copied \n";
                         }
                    }
               }
          }
     }else{
          print "Could not map \n";
     }
     close(FILE);
     chdir "h";
     Disconnect h;
}

--- "EDWARDS, John" <Edwardsj@oup.co.uk> wrote:
> the final one you listed is the correct format
>
> @Shares("\\\\nt01\\c\$\\ShareName")
>
> not sure why it's not working. Can you post some
> more of the code?
>
> John Edwards
> Desktop Support Analyst
> Oxford University Press
>
> E-mail: mailto:edwardsj@oup.co.uk
> Tel: +44 1865 556767 ext. 3147
> Web: http://2186857287/
>
>
>
______________________________________________________
>   Hardware: The parts of a computer system that can
> be kicked...
>
>
> -----Original Message-----
> From: albert lazo [mailto:alazo1@yahoo.com]
> Sent: Friday, September 29, 2000 4:30 AM
> To: perl-win32-admin@listserv1.ActiveState.com
> Subject: Unable to map hidden shares
>
>
> Hi all,
> I'm wondering if someone could help me. I am trying
> to
> loop through hidden network shares using the Map
> function in the FileOp module. The function seems to
> work ok because I can map shares that are not hidden
> but when I try to put a "$" as you need to in NT it
> fails. I have looked at some documentation and have
> preceded the $ with a \ as in \$, this does not
> work.
> Below are the syntax that I have tried. Any help in
> resolving this would be greatly appreciated. Thanks
> in
> advance.
>
> Syntax that I have tried with no success:
>
> @Shares("\\\\nt01\\'c$'\\ShareName")
> @Shares("\\\\nt01\\c'$'\\ShareName")
> @Shares("\\\\nt01\\c\$\\ShareName")
>
> foreach $Share(@Shares) {
>    if(Map h =>$Share) {
>         #rest of code
>
> Again, this does work when mapping regular shares.
>
> Albert
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15
> Free!
> http://photos.yahoo.com/
> _______________________________________________
> Perl-Win32-Admin mailing list
> Perl-Win32-Admin@listserv.ActiveState.com
>
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
> _______________________________________________
> Perl-Win32-Admin mailing list
> Perl-Win32-Admin@listserv.ActiveState.com
>
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin


__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

["att1.eml" (application/octet-stream)]
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic