AutoIt Forums: timebch - AutoIt Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

timebch Sorts files by type, renames, then moves

#1 User is offline   chaos945 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 34
  • Joined: 19-May 04

Posted 24 February 2005 - 05:49 AM

This is a simple script designed to fulfil a request. It was intented to work as an alternative way to back up certain types of files by date.

It will: detect a specified file type, rename the file(s) to their creation date, then move them from a source directory to a destination directory.

It can be used through a command line with the specified arguments only.

Example Syntax:

COMPILED: scriptname.exe <source> <destination> <filetype>
RAW: autoit3.exe <script location\name.au3> <source> <destination> <filetype>

Attached File(s)



#2 User is offline   busysignal 

  • Mass Spammer!
  • PipPipPipPip
  • Group: Full Members
  • Posts: 348
  • Joined: 22-January 05
  • Location:USA

Posted 24 February 2005 - 10:23 AM

Chaos945,

Nice script. I had to make two modifications in the code to make it work. I have attached the revised code so you can see and verify my changes. This code is quite useful.

Thanks

P.S. I added the Screen Shots of the error encountered..


#3 User is offline   Chris_1013 

  • Mass Spammer!
  • PipPipPipPip
  • Group: Full Members
  • Posts: 347
  • Joined: 12-February 04

Posted 25 February 2005 - 09:58 AM

Are you sure you're using the latest version of AutoIt? The two modifications both relate to fairly newish changes to AutoIt (namely, the = 1 thing on the -ArrayInsert function is an optional parameter, and the third parameter on FileGetTime is the return type of FileGetTime.)

This post has been edited by Chris_1013: 25 February 2005 - 03:20 PM


#4 User is offline   busysignal 

  • Mass Spammer!
  • PipPipPipPip
  • Group: Full Members
  • Posts: 348
  • Joined: 22-January 05
  • Location:USA

Posted 26 February 2005 - 10:55 AM

Chris_1013, on Feb 25 2005, 12:58 AM, said:

Are you sure you're using the latest version of AutoIt? The two modifications both relate to fairly newish changes to AutoIt (namely, the = 1 thing on the -ArrayInsert function is an optional parameter, and the third parameter on FileGetTime is the return type of FileGetTime.)


You got me there! I was running the previous version 3.0.102. I did upgrade to the 3.1.0 version and all is well. I guess it has been a while since I did the last upgrade.

Thanks for the heads up..

-Cheers

#5 User is offline   chaos945 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 34
  • Joined: 19-May 04

Posted 28 February 2005 - 05:50 PM

I rewrote this script as a function, currently it will only work on mass files of the same extension I don't have single file functionality programmed in yet.

[ code='text' ]    ( ExpandCollapse - Popup )
: : E x a m p l e : : #include <FileRename.au3> ;             FileRename(iflag, "extension", "source", "destination") $ireturn = FileRename(0, "txt", "Example\Source\", "Example\Destination\") MsgBox(0, "Return", $ireturn) ;__________________________________________________________ ; F L A G S ; 0 = all files ; 1 = single file ;__________________________________________________________ ;__________________________________________________________ ; R E T U R N S ; 0 = incorrect $iflag ; 1 = invalid extension ; 2 = source folder/path does not exist ; 3 = destination folder/path does not exist ; 4 = no files found ; 5 = unable to get file info ; Success = No errors ; Unknown Error = Script finished but there was an error ;__________________________________________________________

Attached File(s)


This post has been edited by chaos945: 28 February 2005 - 05:53 PM


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users