How to automatically include the current date in a batch created file

Some times happen to use old stuff like DOS Command Line. If you want to add current date on filename, you can use this string: %date:~-4,4%%date:~-7,2%%date:~0,2%

Example:

net file > "openfile_stats-%date:~-4,4%%date:~-7,2%%date:~0,2%.txt"
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s