Break OnDim $SO$SO=SetOption('Explicit','On')$SO=SetOption('NoVarsInStrings','On')$SO=SetOption('NoMacrosInStrings','On') Dim $Dir, $Path, $Paths, $File, $Pause, $Index$Dir = ExpandEnvironmentVars(ReadValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders','Desktop'))+'\Test' $Index = 0For Each $File In DirPlus($Dir,"/s /f mp3 mp4 mov avi mpg mpeg wmv asx divx mov jpg gif ") $Path = Left($File.Path, InStrRev($File.Path,"\")) If -1 = AScan($Paths,$Path) ReDim Preserve $Paths[UBound($Paths)+1] $Paths[UBound($Paths)] = $Path EndIf $Index=$Index+1 ''+$Index +': ' +$File + ' ' + $File.Size ?Next 'Press anykey to continue...' ?Get $Pause Function DirPlus($path,optional $Options, optional $f, optional $sfflag) If not vartype($f) DIM $f EndIf If not vartype($sfflag) DIM $sfflag EndIf DIM $file, $i, $temp, $item, $ex1, $mask,$mask1,$maskArray,$maskarray1, $ex2, $code, $CodeWeight, $targetWeight, $weight, $masktrue DIM $tarray[0] $ex1 = SetOption(Explicit,on) $ex2 = SetOption(NoVarsInStrings,on) $codeWeight = 0 If not Exist($path) $temp = SetOption(Explicit,$ex1) $temp = SetOption(NoVarsInStrings,$ex2) Exit @ERROR EndIf If not vartype($f) $f = CreateObject("Scripting.FileSystemObject").getfolder($path) EndIf If @ERROR $temp = SetOption(Explicit,$ex1) $temp = SetOption(NoVarsInStrings,$ex2) Exit @ERROR EndIf For Each $temp In Split($options,"/") $temp=Trim($temp) Select Case left($temp,1) = "s" If not vartype($sfflag) If Val(right($temp,-1)) = 0 $sfflag = -1 Else $sfflag = Val(right($temp,-1)) EndIf EndIf Case Left($temp,1) = "a" Select Case Right($temp,-1)="d" $codeWeight = $codeWeight + 1 $temp = "if $file.attributes & 16 " ;"if $file.type = 'File Folder' " Case Right($temp,-1)="-d" $codeWeight = $codeWeight + 1 $temp = "if ($file.attributes & 16)=0 " ;"if $file.type <> 'File Folder' " Case Right($temp,-1)="s" $codeWeight = $codeWeight + 1 $temp = "if $file.attributes & 4 " Case Right($temp,-1)="-s" $codeWeight = $codeWeight + 1 $temp = "if ($file.attributes & 4)=0 " Case Right($temp,-1)="h" $codeWeight = $codeWeight + 1 $temp = "if $file.attributes & 2 " Case Right($temp,-1)="-h" $codeWeight = $codeWeight + 1 $temp = "if ($file.attributes & 2)=0 " Case Right($temp,-1)="r" $codeWeight = $codeWeight + 1 $temp = "if $file.attributes & 1 " Case Right($temp,-1)="-r" $codeWeight = $codeWeight + 1 $temp = "if ($file.attributes & 1)=0 " Case Right($temp,-1)="a" $codeWeight = $codeWeight + 1 $temp = "if $file.attributes & 32 " Case Right($temp,-1)="-a" $codeWeight = $codeWeight + 1 $temp = "if ($file.attributes & 32)=0 " EndSelect $code = $temp + "$weight=$weight+1 endif" +@CRLF + $code Case Left($temp,1) = "m" $maskarray = Split(Right($temp,-2),"|") $codeweight = $codeweight + 1 $code = "$masktrue=0 for Each $mask in $maskarray if instr($file.name,$mask) $masktrue=1 " + "EndIf Next If $masktrue $weight=$weight+1 endif" + @CRLF +$code Case Left($temp,1) = "f" $maskarray1 = Split(Right($temp,-2)," ") $codeweight = $codeweight + 1 $code = "$masktrue=0 for Each $mask1 in $maskarray1 if substr($file.name,Instrrev($file.name,'.')+1)" + "=$mask1 $masktrue=1 EndIf Next If $masktrue $weight=$weight+1 endif" + @CRLF +$code EndSelect Next $code = "$weight = 0 $targetWeight = " + $codeweight + @CRLF + $code $code = $code + "if $weight = $targetweight Exit 1 endif" For Each $file In $f.subfolders If Execute($code) $tarray[$i] = $file $i = $i + 1 ReDIM preserve $tarray[$i] EndIf If $sfflag $temp = dirplus($file,$options,$file,$sfflag-1) For Each $item In $temp $tarray[$i] = $item $i = $i + 1 ReDIM preserve $tarray[$i] Next EndIf Next For Each $file In $f.files If Execute($code) $tarray[$i] = $file $i = $i + 1 ReDIM preserve $tarray[$i] EndIf Next If $i ReDIM preserve $tarray[$i-1] $i=0 Else $tarray = 0 EndIf $dirplus = $tarray $temp = SetOption(Explicit,$ex1) $temp = SetOption(NoVarsInStrings,$ex2) Exit @ERROREndFunction
Generated in 0.071 seconds in which 0.018 seconds were spent on a total of 12 queries. Zlib compression enabled.
") !=-1) { tempah=tempah.substring(tempah.indexOf("")+5,tempah.indexOf("")); codes[i].innerHTML="" + dotag(tempah.substring()) + ""; } } //var pres = document.getElementsByTagName("pre"); //for (var i=0, maxi = pres.length; i < maxi; i++) { // var tempah = pres[i].innerHTML; // if (tempah.indexOf("[postprep") !=-1) { // tempah=tempah.substring((tempah.indexOf("]",tempah.indexOf("[postprep"))+1)); // pres[i].innerHTML=dotag(tempah); // } //} function ytag(which_one) { var codes = document.getElementsByClassName("ubbcode-body"); var thisone = codes[which_one].innerHTML; codes[which_one].innerHTML = "" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf(""))) + ""; var heads = document.getElementsByClassName("ubbcode-header"); heads[which_one].innerHTML = "Code:" + ' '; } function ttag(which_one) { var codes = document.getElementsByClassName("ubbcode-body"); var thisone = ""; if (codes[which_one].innerText != undefined) { thisone += codes[which_one].innerText; } else { thisone += codes[which_one].textContent; } codes[which_one].innerHTML = thisone + ""; var heads = document.getElementsByClassName("ubbcode-header"); heads[which_one].innerHTML = "Code:" + ' '; }
")+5,tempah.indexOf("
" + dotag(tempah.substring()) + "
" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf(""))) + "
"),thisone.indexOf("
"; if (codes[which_one].innerText != undefined) { thisone += codes[which_one].innerText; } else { thisone += codes[which_one].textContent; } codes[which_one].innerHTML = thisone + "