Using timestamp as unique filename


Using timestamp as unique filename %date% and %time% environment variables display the date and the time respectively. These environment variables can be used to generate a relatively unique string. Here is an example:

SET Unique=%date%_%time%
SET Unique=%Unique:/=.%
SET Unique=%Unique::=.%
SET Unique=%Unique: =%
SET Unique=%Unique:Mon=%
SET Unique=%Unique:Tue=%
SET Unique=%Unique:Wed=%
SET Unique=%Unique:Thu=%
SET Unique=%Unique:Fri=%
SET Unique=%Unique:Sat=%
SET Unique=%Unique:Sun=%
echo %Unique%
SET Unique=&::