What feature do you need most in Dr.Batcher?

Wednesday, August 10, 2011

Removing Unnecessary Dots and Slashes from Date

When you want to use the current date as a part of a file's name, you want to see something like '01012011'. Usual 'date' variable gives you human-readable date with additional dots looking like this: '01.01.2011'. Or something like this: '01/01/2011'. It depends on the settings of your copy of Windows. Fortunately, it is not hard to remove unnecessary characters from the string with the date. All you need to do is to use the following construction:
echo %date:.=%
This code will remove dots from the string with the current date. Can you consider the string that allows you to remove slashes?..

0 comments:

Post a Comment