qwertylol Posted June 18, 2007 Share Posted June 18, 2007 how do i write a script to rename every file in a folder to 1.txt ~ 999.txt? Link to comment Share on other sites More sharing options...
Generator Posted June 18, 2007 Share Posted June 18, 2007 (edited) Try to use _FileListArray(). There are few topics in the example forum. Edited June 18, 2007 by Generator Link to comment Share on other sites More sharing options...
Valuater Posted June 18, 2007 Share Posted June 18, 2007 Because AutoIt lacks a "FileRename" function, use FileMove to rename a file! 8) Link to comment Share on other sites More sharing options...
qwertylol Posted June 18, 2007 Author Share 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 Link to comment Share on other sites More sharing options...
qwertylol Posted June 18, 2007 Author Share 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? Link to comment Share on other sites More sharing options...
Generator Posted June 18, 2007 Share Posted June 18, 2007 Put them in @TempDir Link to comment Share on other sites More sharing options...
qwertylol Posted June 18, 2007 Author Share Posted June 18, 2007 Dim $counter = 0 Do Filemove ( "*.txt", $counter & '.txt') $counter = $counter + 1 Until $counter = 344 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 18, 2007 Moderators Share 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. Link to comment Share on other sites More sharing options...
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