<script language="PerlScript">
use Win32::OLE;
use Win32::OLE::Const;
sub ListIt {
my $arial =("arial"
;
my $center=("center"
;
my $FSO = Win32::OLE->new("Scripting.FileSystemObject"
;
$window->document->{drivebox}->{style}->{fontfamily} = $arial;
$window->document->{drivebox}->{style}->{fontsize} = ("12"
;
$window->document->{folbox}->{style}->{fontfamily}= $arial;
$window->document->{folbox}->{style}->{fontsize} = ("11"
;
$window->document->{filbox}->{style}->{fontfamily} = $arial;
$window->document->{filbox}->{style}->{fontsize} = ("11"
;
$window->document->{lab}->{style}->{textalign} = $center;
$window->document->{lab}->{style}->{pixelwidth} = ("450"
;
$window->document->{labfil}->{style}->{textalign} = $center;
$window->document->{labfil}->{style}->{pixelwidth} = ("440"
;
$window->document->{labfil}->{innertext} ="No file selected->";
my $Drvs = $FSO->{Drives};
foreach my $oDrv (in ($Drvs)){
if (my $oDrv->DriveType = "2"
{
$sVal = $oDrv->{DriveLetter};
$sName = $sVal & " - " & $oDrv->{VolumeName};
$Opt = $window->document->{createElement}("OPTION"
;
$window->document->{Opt}->{text} = $sName;
$window->document->{Opt}->{value} = $sVal;
$window->document->{drivebox}->{add} = $Opt;
$window->{execScript $UpdateDrive "c"};
}
}
next ;
undef $Drvs;
}
sub drivebox_onchange {
if ($window->document->{drivebox}->{value} =""
{
}
my $dbvalue = $window->document->{drivebox}->{value};
$window->{execScript}(UpdateDrive($dbvalue));
}
sub folbox_onclick {
if ($window->document->{folbox}->{value} =0) {
$sFolPath = $window->document->{folbox}->{value};
$window->document->{lab}->{innertext} = $sFolPath;
$window->{execScript}(UpdateFolder($sFolPath));
}
}
sub folbox_ondblclick {
#--change folder box to subfolder contents of clicked folder->
if ($window->document->{folbox}->{value} = 0){
$sFolPath = $window->document->{folbox}->{value};
$window->document->{lab}->{innertext} = $sFolPath;
$window->{execScript}(UpdateFolder($sFolPath));
$window->{execScript}(GetSubFolders($sFolPath));
}
}
sub filbox_onclick {
$window->document->{labfil}->{innertext} = $sFolPath & '\\' & $window->document->{filbox}->{value};
}
sub UpdateDrive($sDrive) {
my $FSO1= Win32::OLE->new("Scripting.FileSystemObject"
;
my $Opt = $window->document->{createElement} = ("OPTION"
;
$window->document->{Opt}->{text} = "________________________________________";
$window->document->{Opt}->{value} =("0"
;
$window->document->{folbox}->{add} = $Opt;
my $Opt1 = $window->document->{createElement} = ("OPTION"
;
$window->document->{Opt}->{text} = "________________________________________";
$window->document->{Opt}->{value} = ("0"
;
$window->document->{filbox}->{add} = $Opt1;
my $oDrv = $FSO1->GetDrive($sDrive & ":\\"
;
my $oFol1 = $oDrv->{RootFolder};
my $oFols = $oFol1->{SubFolders};
foreach $oFol (in ($oFols)) {
$sFol = $oFol->{Name};
$PFol = $oFol->{Path};
my $Opt2 = $window->document->{createElement} = ("OPTION"
;
$window->document->{Opt}->{text} = $sFol;
$window->document->{Opt}->{value} = $PFol;
$window->document->{folbox}->{add} = $Opt2;
}
next
my $oFils = $oFol1->Files;
foreach $oFil (in ($oFils)) {
my $sFil = $oFil->{Name};
my $Opt3= $window->document->{createElement} = ("OPTION"
;
$window->document->{Opt}->{text} = $sFil;
$window->document->{Opt}->{value} = $sFil;
$window->document->{filbox}->{add} = $Opt3;
}
next
undef $FSO1;
my $sFolPath = $sDrive & (":"
;
$window->document->{lab}->{innertext} = $sFolPath;
}
</script>
use Win32::OLE;
use Win32::OLE::Const;
sub ListIt {
my $arial =("arial"
my $center=("center"
my $FSO = Win32::OLE->new("Scripting.FileSystemObject"
$window->document->{drivebox}->{style}->{fontfamily} = $arial;
$window->document->{drivebox}->{style}->{fontsize} = ("12"
$window->document->{folbox}->{style}->{fontfamily}= $arial;
$window->document->{folbox}->{style}->{fontsize} = ("11"
$window->document->{filbox}->{style}->{fontfamily} = $arial;
$window->document->{filbox}->{style}->{fontsize} = ("11"
$window->document->{lab}->{style}->{textalign} = $center;
$window->document->{lab}->{style}->{pixelwidth} = ("450"
$window->document->{labfil}->{style}->{textalign} = $center;
$window->document->{labfil}->{style}->{pixelwidth} = ("440"
$window->document->{labfil}->{innertext} ="No file selected->";
my $Drvs = $FSO->{Drives};
foreach my $oDrv (in ($Drvs)){
if (my $oDrv->DriveType = "2"
$sVal = $oDrv->{DriveLetter};
$sName = $sVal & " - " & $oDrv->{VolumeName};
$Opt = $window->document->{createElement}("OPTION"
$window->document->{Opt}->{text} = $sName;
$window->document->{Opt}->{value} = $sVal;
$window->document->{drivebox}->{add} = $Opt;
$window->{execScript $UpdateDrive "c"};
}
}
next ;
undef $Drvs;
}
sub drivebox_onchange {
if ($window->document->{drivebox}->{value} =""
}
my $dbvalue = $window->document->{drivebox}->{value};
$window->{execScript}(UpdateDrive($dbvalue));
}
sub folbox_onclick {
if ($window->document->{folbox}->{value} =0) {
$sFolPath = $window->document->{folbox}->{value};
$window->document->{lab}->{innertext} = $sFolPath;
$window->{execScript}(UpdateFolder($sFolPath));
}
}
sub folbox_ondblclick {
#--change folder box to subfolder contents of clicked folder->
if ($window->document->{folbox}->{value} = 0){
$sFolPath = $window->document->{folbox}->{value};
$window->document->{lab}->{innertext} = $sFolPath;
$window->{execScript}(UpdateFolder($sFolPath));
$window->{execScript}(GetSubFolders($sFolPath));
}
}
sub filbox_onclick {
$window->document->{labfil}->{innertext} = $sFolPath & '\\' & $window->document->{filbox}->{value};
}
sub UpdateDrive($sDrive) {
my $FSO1= Win32::OLE->new("Scripting.FileSystemObject"
my $Opt = $window->document->{createElement} = ("OPTION"
$window->document->{Opt}->{text} = "________________________________________";
$window->document->{Opt}->{value} =("0"
$window->document->{folbox}->{add} = $Opt;
my $Opt1 = $window->document->{createElement} = ("OPTION"
$window->document->{Opt}->{text} = "________________________________________";
$window->document->{Opt}->{value} = ("0"
$window->document->{filbox}->{add} = $Opt1;
my $oDrv = $FSO1->GetDrive($sDrive & ":\\"
my $oFol1 = $oDrv->{RootFolder};
my $oFols = $oFol1->{SubFolders};
foreach $oFol (in ($oFols)) {
$sFol = $oFol->{Name};
$PFol = $oFol->{Path};
my $Opt2 = $window->document->{createElement} = ("OPTION"
$window->document->{Opt}->{text} = $sFol;
$window->document->{Opt}->{value} = $PFol;
$window->document->{folbox}->{add} = $Opt2;
}
next
my $oFils = $oFol1->Files;
foreach $oFil (in ($oFils)) {
my $sFil = $oFil->{Name};
my $Opt3= $window->document->{createElement} = ("OPTION"
$window->document->{Opt}->{text} = $sFil;
$window->document->{Opt}->{value} = $sFil;
$window->document->{filbox}->{add} = $Opt3;
}
next
undef $FSO1;
my $sFolPath = $sDrive & (":"
$window->document->{lab}->{innertext} = $sFolPath;
}
</script>