From:                   Ryan Guy <[EMAIL PROTECTED]>

> How do I check to see if a drive (i.e. C: or D:) exists??
> 
> I am writing a script to couple start menu files to the all users
> directory of different windows configurations and I need to know this
> to edit the shortcuts on some machines (forget about why).  Any help
> would be greatly appreciated.

If you don't mind you'll miss CDs you can use -e :

        print "C: exists\n" if -e 'c:\\';
        ...

If you do mind try :

        use Win32::FileOp qw(Substed);
        print "C: exists\n" if  Substed 'c:';
        ...

and if you want to get all drives use

        @drives = sort keys %{Substed()};

[Shorthand for]
        %drives = Substed();
        @drives = keys %drives;
        @drives = sort @drives;
[/Shorthand]

Not sure this'll work under Win9x as well, but under WinNT/2K it 
gives you all local as well as mapped drives.

HTH, Jenda

=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
                                        --- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to