Jump to content

How to rename a file


strate
 Share

Recommended Posts

CORRECTION: Sorry brainfart... you need to use FileMove so you dont have 2 files. Example:

FileMove("C:\MyFile.txt", "C:\MyNewFile.def")

That should work... it is untested but check the helpfile for more assistance.

*** Matt @ MPCS

Link to comment
Share on other sites

CORRECTION: Sorry brainfart... you need to use FileMove so you dont have 2 files. Example:

FileMove("C:\MyFile.txt", "C:\MyNewFile.def")

That should work... it is untested but check the helpfile for more assistance.

*** Matt @ MPCS

<{POST_SNAPBACK}>

It seems weird that when you've read the help file forty thousand times the simple solutions don't come to mind. Well for me anyways. Sorry the FileCopy worked perfect. The extra file is fine I can keep a record of what the operater did.

Thanks again.

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Link to comment
Share on other sites

  • Developers

Please explain more about what you mean.

<{POST_SNAPBACK}>

he means: run the Good Old dos command rename or ren.

runwait(@comspec & " /c rename from.txt to.def')
Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Also jumping from Matt's example you could use the following :)

FileMove("C:\YourFile.txt", "C:\*.def")

That way it keeps the same file name...

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...