I need a script to automate file moving according to its names rules (II)

I need a vbs script to make the following - inside a directory I have many files which have a similar name (only the 2 last characters are different - for example aaaa10, aaaa11, aaaa12, aaaa13; bbbb10, bbbb12, bbbb13, bbbb14). I need an automatic way to move that group of files that only have the 2 last characters different to a sub-directory with the name corresponding to common characters (for example, for aaaa10, aaaa12, aaaa13, aaaa14 it will create a sub-directory named aaaa, and aaaa10, aaaa12, aaaa13, aaaa14 will be moved inside aaaa). Can you understand what I want ? I do not know to program :( My operating system is Windows XP. If you look at http://www.experts-exchange.com/Programming/Q_21812622.html you can see I have posted a similar question but the difference was only the last character... Just modify that vbs script... I wish I know to program !... Now I have no free time but in future I will learn VB ! Thanks.
Who is Participating?
Change this line:

    baseName = Left(file.Name, Len(file.Name) - 5)


    baseName = Left(file.Name, Len(file.Name) - 6)
asgarcymedAuthor Commented:
*) It is always two characters that are different at the end of the filenames;
*) The common part of the names is variable (not always 4 as I used in the example);
*) All the files are in the same folder at the same level (no recurse into subfolders needed);
*) I want the new sub directory in the same folder as the file.
Mike TomlinsonMiddle School Assistant TeacherCommented:

Study the code asgarcymed.  Now is a great time to start learning!

You can find documentation on the language here:

And documention for the File System Object classes here:
asgarcymedAuthor Commented:
vinnyd79 - That's it, thank you a lot !
asgarcymedAuthor Commented:
Idle_Mind  - thank your for the advices and links !
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.