qwertylol Posted June 18, 2007 Posted June 18, 2007 how do i write a script to rename every file in a folder to 1.txt ~ 999.txt?
Generator Posted June 18, 2007 Posted June 18, 2007 (edited) Try to use _FileListArray(). There are few topics in the example forum. Edited June 18, 2007 by Generator
Valuater Posted June 18, 2007 Posted June 18, 2007 Because AutoIt lacks a "FileRename" function, use FileMove to rename a file! 8)
qwertylol Posted June 18, 2007 Author Posted June 18, 2007 Because AutoIt lacks a "FileRename" function, use FileMove to rename a file!8)uh i am very out of it, i get it to use *.txt in the "source", but i am not sure about dest
qwertylol Posted June 18, 2007 Author Posted June 18, 2007 uh i am very out of it, i get it to use *.txt in the "source", but i am not sure about destDoFilemove ( "source", "dest" ) Filemove ( "*.txt", "$counter + txt" )Until donehow do i write the "dest" part?
qwertylol Posted June 18, 2007 Author Posted June 18, 2007 Dim $counter = 0 Do Filemove ( "*.txt", $counter & '.txt') $counter = $counter + 1 Until $counter = 344
Moderators SmOke_N Posted June 18, 2007 Moderators Posted June 18, 2007 Dim $counter = 0 Do Filemove ( "*.txt", $counter & '.txt') $counter = $counter + 1 Until $counter = 344You could run into some serious issues with what you have there, better think through your logic a tad.#include <file.au3> $aArray = _FileListToArray(@ScriptDir, '*.txt') For $iCC = 1 To UBound($aArray) - 1 FileMove(@ScriptDir & '\' & $aArray[$iCC], @ScriptDir & '\' & $iCC & '.txt') Next Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now