Jump to content
Sign in to follow this  
volkerimmler

file rename

Recommended Posts

volkerimmler

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
themax90

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
themax90

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

Share this post


Link to post
Share on other sites
randallc

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.