Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Folders named as the current month by command line

I have this code :

 xcopy  "C:\30*.zip"  "C:\Folder\"

what i want is to copy the zip files to a new folder, this folder named as the current month

ex : March , April

I'm using Windows Server2008 R2.

share|improve this question

migrated from stackoverflow.com Dec 27 '11 at 3:18

This question came from our site for professional and enthusiast programmers.

marked as duplicate by studiohack Feb 16 '12 at 15:04

This question was marked as an exact duplicate of an existing question.

    
Thanks @bobbymcr – Mahmoud AL-saadi Dec 25 '11 at 8:30

You can retrieve the month as

@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @(

Set Month=%%A

Set Day=%%B

Set Year=%%C ) @echo Month = %Month%

But remember this depends on the regional date format.

Then you can create folder

MD Month . and copy the zip in the new Month folder created

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.