Jump to content

Has anyone used autoit to add a time stamp to a filename?


Recommended Posts

  • Moderators

FileSetTime() ?

Might want to say that's in the Beta version.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to post
Share on other sites
  • Developers

Has anyone used autoit to add a time stamp to a filename?

Something like the below will rename the copy of the file :

FileCopy("c:\the\source\file.name","c:\the\backup\" & @year & @mon & @mday & "_file.name",1)

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 post
Share on other sites

Something like the below will rename the copy of the file :

FileCopy("c:\the\source\file.name","c:\the\backup\" & @year & @mon & @mday & "_file.name",1)

It worked. I will freaking make a denation after I get the raise for my new promotion!!!

Thanks guys!! I will be visiting this site often. I am new to scripting. I remember using a few dos commands in 2000 in my first IT job for a little troubleshooting, but nothing major at all. This software will help me tremendously in my new position.

All weekend I will be learning using the tutorial. If you guys have any ideas that will help me please let me know. Now I need to add something to the above script in case the user creates more than one of the same report in the same day. I don't want the script for it, but if someone can point me in the right direction on what to read in the tutorial it will be appreciated.

Edited by MaCgyver
Link to post
Share on other sites
  • Developers

This didn't work, but I am going to read the tutorial and figure it out. I don't see FileSetime in the script so maybe that is the problem, but I'm a newbie. I am really excited about this software. I am getting a promotion and this software will help me extremely in my new position. I'm looking at a real nice raise. ;)

It all depends what you want to do . Do you want to rename the backup file so it contains todays date, or do you want to update the Filedate of the backup copy ???

:lmao:

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 post
Share on other sites
  • Developers

Now I need to add something to the above script in case the user creates more than one of the same report in the same day. I don't want the script for it, but if someone can point me in the right direction on what to read in the tutorial it will be appreciated.

Look for FileExists() to check if its already there ..

If so start a loop to add a counter value behind the targetfilename until the file doesn't exists and then copy it....

:lmao:

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 post
Share on other sites
  • Moderators

Nah, Public release of AutoIt v3.1.1 has FileSetTime(). :lmao:

;) Dope... Both my versions are Beta!! I didn't remember it in the PR!!... So glad your always there to pick me up when I fall flat on my face o:)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...