Make page narrow Make page wide    Green theme Blue theme Orange theme Red theme

baner
You are here:   Home > Author-it Resources > Tips and Tricks > Renaming Publishing Folders with Current Time
large small default
Renaming Publishing Folders with Current Time PDF Print
Written by Hamish   
Sunday, 26 April 2009 11:58

This tip shows how you can use Publishing Profiles and an after publish batch file to rename the publishing folder with a unique name - the current date and time.

Create the Batch File

Create a text called rename_dir.bat and save it in a central location, for example, C:\Program Files\Author-it 5\Data\Templates. Paste the following commands in the text file and save it:


@echo off
for /f "tokens=2 delims=/- " %%f in ('date /t') do (set dd=%%f)
for /f "tokens=3 delims=/- " %%g in ('date /t') do (set mm=%%g)
for /f "tokens=4 delims=/- " %%k in ('date /t') do (set yy=%%k)
for /f "tokens=1 delims=/: " %%h in ('time /t') do (set hh=%%h)
for /f "tokens=2 delims=/: " %%m in ('time /t') do (set mm=%%m)

set foldername=%yy%-%mm%-%dd%_%hh%-%mm%

rename %1 %foldername%

 

Set Up Publishing Profile to Call Batch File

Add an "After Publishing" Command Line action to the Publishing Profile that calls the batch file, as shown below.

 

Comments

Name *
Email (for verification and replies)
URL
Submit Comment
Last Updated on Sunday, 26 April 2009 12:31