Windows – Folders named as the current month by command line

scriptwindows server 2008

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

Best Answer

Here is a clunky way of doing it in powershell:

$a = "C:\Folder\"
$a +=get-date -format MMMM
xcopy "c:\30*.zip" $a /I