# Using variables to rename a folder

**URL:** https://www.finalbuilder.com/forums/t/using-variables-to-rename-a-folder/1734
**Category:** Discussion
**Created:** [April 6, 2011, 1:27am UTC](https://www.finalbuilder.com/forums/t/using-variables-to-rename-a-folder/1734 "2011-04-06T01:27:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 6, 2011, 1:27am UTC](https://www.finalbuilder.com/forums/t/using-variables-to-rename-a-folder/1734/1 "2011-04-06T01:27:56Z")

</div>

As part of our nightly build process, we would like to rename the prior build folder to something that contains the date & time. Eg:

c:\DEV =\> c:\DEV201104052300

I haven't figured out how to do this but I thought that I might be able to setup a variable with the Date/time and append that to 'DEV' which I can then use in the rename action.

In addition, I'd like to be able to delete old build folders that are older than a specified number of days.

Thanks,

Charles&nbsp;

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 6, 2011, 2:35am UTC](https://www.finalbuilder.com/forums/t/using-variables-to-rename-a-folder/1734/2 "2011-04-06T02:35:38Z")

</div>

Hi Charles,

Edit: Go with Steve's (below), his is a bit cleaner and doesn't resort to a script action. I'll leave mine attached just in case you want to see an different way to achieve the same time.

&nbsp;

Cheers,

&nbsp;

Ben
[folder\_demo.fbz7](https://www.finalbuilder.com/forums/uploads/default/original/2X/6/6b454799036909d6e47ccb086d4680e6c42cb7d7.fbz7) (3.345 KB)

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [April 6, 2011, 2:36am UTC](https://www.finalbuilder.com/forums/t/using-variables-to-rename-a-folder/1734/3 "2011-04-06T02:36:30Z")

</div>

Hi Charles

I have attached a simple example that should help.

Regards,

Steve

[FolderNaming.fbz7](https://www.finalbuilder.com/forums/uploads/default/original/2X/e/ef8c8cae83659c6b1fdbd153f4f8ff9f9c58071a.fbz7) (3.836 KB)

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 6, 2011, 7:17am UTC](https://www.finalbuilder.com/forums/t/using-variables-to-rename-a-folder/1734/4 "2011-04-06T07:17:11Z")

</div>

&nbsp;Thanks to both of you. I am still getting to grips with FB and of course I should re-read the help each time I think of a question as the answer is probably in there&nbsp;
