Sign in to follow this  
Followers 0
MI74

Change File Name

6 posts in this topic

If someone would be so kind or at least take pity on me.. My problem is that I have a folder of files that need to have .txt added to their name. Could someone help me get started or at least point me in the right direction?

Thank you for your patience and guidance, or should I say tolerance on behalf of all newbies.

Share this post


Link to post
Share on other sites



Hi,

read the files into an array and then use FileMove to rename them.

So long,

Mega


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

Share this post


Link to post
Share on other sites

read the files into an array and then use FileMove to rename them.

_FileListToArray() ...

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

HI,

here is somethi gto start with

#Include <File.au3>
#Include <Array.au3>

Global $directory = FileSelectFolder("Chose files: ", "", 4, "c:") & "\"
Global $FileList = _FileListToArray($directory, '*.txt')
Global $add = ".hugo"

If (Not IsArray($FileList)) and (@error = 1) Then
    MsgBox(0, "", "No Files\Folders Found.")
    Exit
EndIf

_ArrayDisplay($FileList,"")

For $i=1 To UBound($FileList)-1
    If FileMove($directory & $FileList[$i], $directory & $FileList[$i] & $add ,1) = 0 Then ConsoleWrite("Error" & $i &  " " & $FileList[$i])
Next

So long,

Mega


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

Share this post


Link to post
Share on other sites

is there a way to load the file list into an Array without alphabetizing them?

Share this post


Link to post
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
Sign in to follow this  
Followers 0