I would like to redirect the output of a command (in the Windows command line) to a file which name is the current date and time. For example:
my_path\mysqldump.exe my_database_name > auto_generated_file_name
where auto_generated_file_name should be something like 2010_09_30___11_41_58.txt.
This command will automatically run from time to time. This is the reason I need the file name to be automatically generated.
What is the easiest method to achieve this ?
The following command creates a blank file with the expected filename:
You can use the part after
type nul >in place of yourauto_generated_file_name.