Jump to content

Recommended Posts

Posted

Is it possible to rename a file? I have a .txt and I want to rename it as a .def how would I do this?

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
Posted

If you want to use AutoIt use FileCopy. You have to be kinda creative with the functions we have, and think outside the box to apply them to what you need. :)

*** Matt @ MPCS

Posted

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

Posted

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...
Posted

yeah it works. what i suggested works in %comspec%

<{POST_SNAPBACK}>

Please explain more about what you mean.
INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...
  • Developers
Posted (edited)

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.
  :)

Posted

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)

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
×
×
  • Create New...