Jump to content

question about creating folders and moving files


Recommended Posts

Hello everyone

I have a folder that have thousands of  image files

I want to organize them, by creating folders within the root folder, and moving 300 files in each newly created folder according to there last modified time.

I not posible to sort acording to last modified time, random moving of files will also do. New  folders should be named as 1, 2, 3 etc. Not able to fuigure out how to do it. 

Any help ?

Safdar

Link to comment
Share on other sites

I would start with

FileListToArray

FileGetTime for sorting

_ArraySort

For Next loop

Create new folder with a $var

and after 300 Create new folder with $var +1

FileMove ...

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Not able to fuigure out how to do it. Any help ?

I would start with reading the Help file, becoming familiar with what can be done with AutoIt. As I'm browsing thru the Help file, thoughts would cross my mind, like, "Hmm, this'll do what I want.". BTW, all the functions mentioned above by Xenobiologist will do just what you're looking for. Now I'm sure that sooner or later someone here will post some code that may or may not be just what you're looking to do, but I suggest coming up with some code yourself, then post it and any "why?" questions..

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

When I run

For $var = 1 to 3
   DirCreate($var)
      Next

It creates folders named 1 to 3 on the desktop,

but I want to create folders here

E:BackupsImages of c drive

when I run

For $var = 1 to 3
   DirCreate("E:BackupsImages of c drive$var")
      Next

It just creates a folder named $var

Link to comment
Share on other sites

  • Developers

You need to concatenate the Variable to the literal string:

"E:\Backups\Images of c drive\" & $var

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...