Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2007
    Posts
    63

    Smile use current date to rename a file

    Need some help again, How would I rename a file to the current date and time it was renamed?

    Example:

    date = current date (ex. 11272007)
    time = current time (ex. 0325AM)

    File.Rename("C:\\Temp\\filename.txt", "C:\\Temp\\filename_date_time.txt");

    So, the new file name will look like below:

    filename_11272007_0325AM.txt

    Anybody?

    Thanks in advanced...

    yhb)

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Simple enough:

    date = current date (ex. 11272007)
    time = current time (ex. 0325AM)

    File.Rename("C:\\Temp\\filename.txt", "C:\\Temp\\filename_"..date.."_"..time..".txt" );

    Good luck
    Yossi

  3. #3
    Join Date
    Sep 2007
    Posts
    63

    Smile

    but isn't that only will picked up what i have in my date and time? not the actual date and time it was renamed? :(

    yhb)

  4. #4
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    If you use the System.GetTime and System.GetDate actions, you are getting these values in realtime. Then when you rename the file , using your variables, the file will be renamed accordingly.

    Yossi

  5. #5
    Join Date
    Sep 2007
    Posts
    63

    Smile

    I got your point... Thanks much...

    yhb)

Similar Threads

  1. Best way to share custom buttons with the group?
    By mwreyf1 in forum AutoPlay Media Studio 6.0
    Replies: 10
    Last Post: 04-28-2010, 01:29 PM
  2. Function: Compare File Date to ISO Date
    By Lorne in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 05-10-2004, 05:35 PM
  3. HOWTO: Make an AutoPlay Application Expire
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-09-2002, 10:10 AM
  4. Replies: 0
    Last Post: 08-17-2000, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts