I'm trying to save the compilation time of a project on a text file every time a project is compiled/built, so I've tried to put the following command in the project's options Post-Build Action:
echo %date% %time% > "$(PROJECTDIR)\$(PROJECTNAME).txt"
But Cmd-style %date% variables won't work. I've also tried the following:
yyyy.MMdd
))Calling cmd:
cmd.exe /C echo %date% %time% > "$(PROJECTDIR)\$(PROJECTNAME).txt"
But none of those options work. I know there are Community Tasks that enable this sort of thing but I'm trying to avoid the need to install them in every developer's PC.
You can pull the date/time from the project you just built and send it to a text file, with the date and time on a single line. Add this to the post-build commands:
for /f "tokens=1,2,3 delims= " %%i in ('dir "$(OUTPUTDIR)$(OUTPUTFILENAME)" ^| find "$(OUTPUTFILENAME)"') do echo %%i %%j %%k > "$(PROJECTDIR)$(PROJECTNAME).txt"