Indigo Rose Software
  #1  
Old 11-22-2007
yhb's Avatar
yhb yhb is offline
Forum Member
 
Join Date: Sep 2007
Posts: 47
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)
Reply With Quote
  #2  
Old 11-22-2007
yosik's Avatar
yosik yosik is offline
Indigo Rose Customer
 
Join Date: Jun 2002
Location: Israel
Posts: 1,863
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
Reply With Quote
  #3  
Old 11-22-2007
yhb's Avatar
yhb yhb is offline
Forum Member
 
Join Date: Sep 2007
Posts: 47
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)
Reply With Quote
  #4  
Old 11-22-2007
yosik's Avatar
yosik yosik is offline
Indigo Rose Customer
 
Join Date: Jun 2002
Location: Israel
Posts: 1,863
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
Reply With Quote
  #5  
Old 11-22-2007
yhb's Avatar
yhb yhb is offline
Forum Member
 
Join Date: Sep 2007
Posts: 47
Smile

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

yhb)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to share custom buttons with the group? mwreyf1 AutoPlay Media Studio 6.0 10 09-03-2009 05:01 AM
http://yourfilelink.com - 50MB max upload, free! Intrigued General Chat 14 09-26-2006 09:44 AM
Function: Compare File Date to ISO Date Lorne AutoPlay Media Studio 5.0 Examples 0 05-10-2004 06:35 PM
HOWTO: Make an AutoPlay Application Expire Support AutoPlay Media Studio 4.0 Examples 0 10-09-2002 11:10 AM
Install only into one of several directories with specific existing file? RichardShaw Setup Factory 5.0 0 08-17-2000 03:29 PM


All times are GMT -6. The time now is 04:41 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software