Sign in to follow this  
Followers 0
volkerimmler

file rename

5 posts in this topic

After searching the manual and the forum, I have not been able to find any way to rename a file in autoit. Is there a way?

Thank you

Share this post


Link to post
Share on other sites



Dim $FileToRename = "C:\File.txt", $NewName = "C:\File-Log.txt"
FileCopy($FileToRename, $NewName)
FileDelete($FileToRename)

Share this post


Link to post
Share on other sites

No problem, theres probably a more efficent way out there, but that will do.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

There is also a UDF that uses DOS if you don't want to copy and delete;; link from "DOScoms" in my signature;

;Syntax; _RenameDOS($s_file,$s_new_file)

; cf "DOSRenameExample.au3" Example at that link.

Best, Randall

Edited by randallc

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