abhay_547
November 19th, 2010, 06:02 AM
Hi All,
I want to create a batch file which will create a folder first with current date as name of the folder and then move all files from a particular folder of sharedrive to another folder excluding some files. I have got the below code which successfully creates the folder with current date as name of the folder but doesn't move any files. Please help...
@ECHO OFF
SET D=%Date:/=%
SET D=%D:~4,4%
SET D=%D%%Date:~-2%
MD "\\dv\month\%D%"
FOR /f %%a IN ('DIR /b "\\dv\month\date\*.*"') DO (
IF NOT "%%a"=="abc.zip" (
IF NOT "%%a"=="xyz.zip" ECHO MOVE "%%a"
)
)
Thanks a lot for your help in advance.
I want to create a batch file which will create a folder first with current date as name of the folder and then move all files from a particular folder of sharedrive to another folder excluding some files. I have got the below code which successfully creates the folder with current date as name of the folder but doesn't move any files. Please help...
@ECHO OFF
SET D=%Date:/=%
SET D=%D:~4,4%
SET D=%D%%Date:~-2%
MD "\\dv\month\%D%"
FOR /f %%a IN ('DIR /b "\\dv\month\date\*.*"') DO (
IF NOT "%%a"=="abc.zip" (
IF NOT "%%a"=="xyz.zip" ECHO MOVE "%%a"
)
)
Thanks a lot for your help in advance.