Jump to content
Sign in to follow this  

Script for finding all JPEG's in all subfolders of dir.

Recommended Posts

Hello, im trying to write a script that will go through a folder, pick out the JPEG's and then resize them changing the name to "BACKUP"originalname.jpg.

Im using a DOS command to give me a superdirlist, THE PROBLEM IS... it is only running through this sequence once but on that one go its working fine. So its only re-sizing one image. 

here is my script so far: (ill just include the part i think there is a problem with but let me know if any more would help)

$file = "E:ImageResizeNEWsuperdirlist.txt"


For $i = 1 to _FileCountLines($file)
    $line = FileReadLine($file, $i)
Local $filename = StringSplit($line, "")
For $i = 1 To $filename[0] ; Loop through the array returned by StringSplit to display the individual values.
        $doescontain = StringInStr($filename[$i], ".jpg")
If $doescontain <> 0 Then
MsgBox($MB_SYSTEMMODAL, "", "$filename[" & $i & "] - " & $filename[$i])
Here is the contents of my superdirlist.txt:


Share this post

Link to post
Share on other sites

First of all, get rid of all of that code.

Look up _FileListToArrayRec in help file.

It will return an array of all .jpg files in your folder and subfolders.

You then loop through it and do whatever it is you do with them.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...