Sign in to follow this  
Followers 0
MaCgyver

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

10 posts in this topic

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

Share this post


Link to post
Share on other sites



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

FileSetTime() ?

[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Share this post


Link to post
Share on other sites

FileSetTime() ?

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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:

I updated my post. It worked how I wanted it to.

Share this post


Link to post
Share on other sites

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:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

[center]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.[/center]

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