Anton Egorov
Anton Egorov

Reputation: 101

VS2015, how to add TimeStamp to the output directory name?

I am using VS2015, common C++ project. Is it possible to add current time or date or timestamp to the name of the output directory?

For example: I press the "Build" button at 15:23:45 and the .exe file outputs to the /bin/2016_02_29-15_23_45.

Upvotes: 2

Views: 958

Answers (1)

norisknofun
norisknofun

Reputation: 879

An alternative solution is to add a post-build event running a script adding a folder link named with your timestamp and targeting the output folder.

For the timestamp, follow this link

Something like that :

 set timestamp= ...
 mklink /D %timestamp% %1

Invoke this script passing as first the wanted vs2015 var, myscript.bat ${OUTPUTFOLDER}

NB: You may need to have admin permissions to invoke mklink

Upvotes: 1

Related Questions