#199501 - 2010-08-12 03:17 PM
Rename file with date using "move"
|
Nicklas
Fresh Scripter
Registered: 2010-06-07
Posts: 6
Loc: Sweden
|
Hi!
Trying to rename a file with the acctual date and time. Want it to look like this: "backup 2010-08-12.bkf"
Move "H:\Backup\backup.bkf" "H:\Backup\backup @date.bkf" @date dosent seem to work, what have I done wrong?
/Nicklas
|
Top
|
|
|
|
#199502 - 2010-08-12 03:43 PM
Re: Rename file with date using "move"
[Re: Nicklas]
|
eriqjaffe
Hey THIS is FUN
Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
|
Try it like this:
Move Move "H:\Backup\backup.bkf" "H:\Backup\backup "+@date+".bkf"
|
Top
|
|
|
|
#199504 - 2010-08-12 04:06 PM
Re: Rename file with date using "move"
[Re: eriqjaffe]
|
Nicklas
Fresh Scripter
Registered: 2010-06-07
Posts: 6
Loc: Sweden
|
Thx for the tip, unfortunatly it dosnīt work. I guess you made a typo when you wrote "Move Move". Only shows a error on that row.
Writing this does not work either.
Move "H:\Backup\backup.bkf" "H:\Backup\backup "+@date+".bkf"
If I remove the "+" todays date shows up on the screen, but it dosenīt save it to the file. Am I using the wrong command?
Move "H:\Backup\backup.bkf" "H:\Backup\backup "@date".bkf"
OS: Windows 2003 Kix Ver: 4.61.0.0
|
Top
|
|
|
|
#199505 - 2010-08-12 04:16 PM
Re: Rename file with date using "move"
[Re: Nicklas]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
You have to replace the "/"s with "-"s
try with Kix 4.61
Move "H:\Backup\backup.bkf" "H:\Backup\backup " + replace(@date,"/","-") + ".bkf"
older kix
Move "H:\Backup\backup.bkf" "H:\Backup\backup " + join(split(@date,"/"),"-") + ".bkf"
|
Top
|
|
|
|
#199507 - 2010-08-12 04:30 PM
Re: Rename file with date using "move"
[Re: Allen]
|
Nicklas
Fresh Scripter
Registered: 2010-06-07
Posts: 6
Loc: Sweden
|
It worked!
thx alot!
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 369 anonymous users online.
|
|
|