Wednesday, March 25, 2009

DOS - Tips for DATE and WINZIP

1. For printing DATE in DOS, we use DATE. The format in which the DATE is displayed varies from profile to profile. If you want to change the format of the date, then go to Control Panel>Regional and Language Options. Go to Regional Options tab and click on the Customize button. Go to the Date tab and change the way you want your date to be displayed. You can also change the Date format using the Date separator in the same tab.
Now go to the command prompt and type DATE to get the date display in the format you desire. This is particularly useful when you want to create a file with DATE in its name. If you have '\' in your date, there would be an error.

2. To winzip a file using DOS, locate your Zip exe. Generally, it is in 'Program Files'. Use the following syntax to zip all the .txt files in the folder F:\test. In this example below, we desire a zip file with the name beginning with Ru appended with today's date. So, the name of the zip file created on 03-19-2009 should be:
"C:\Program Files\WinZip\WZZIP" "F:\test\RU%DATE%.ZIP" F:\test\*.txt